Bennett Helm wrote:
>> So the fault lies in "prependEnvPath". Yet Andreas says that this
>> (identical) code works perfectly for him when using the 1.4.x version.
>> I'm a bit baffled.
> 
> It works perfectly for me, too, in 1.4.x. (I use gcc version 3.1 for
> lyx-1.4, but 2.95.2 for lyx-1.3.

Ok.

>> Could you post the output of:
>>
>> $ grep -e 'HAVE_SETENV' -e 'HAVE_PUTENV' config.h
> 
> 10:45:30 | bennett:~/lyx/lyx-1_3_x/src> grep -e 'HAVE_SETENV' -e
> 'HAVE_PUTENV' config.h
> #define HAVE_PUTENV 1
> #define HAVE_SETENV 1
> 
> 
>> Also, could you alter this function in src/support/filetools.C:
> 
> Output from console:
> 
> Env var "PATH", "/usr/bin:/bin:/usr/sbin:/sbin:/Users/bennett", is
> prepended with "/Applications/LyX-136.app/Contents/MacOS/"
> setEnvPath(PATH) == 1
> result:
> lyxrc.path_prefix is
> /usr/bin:/usr/local/bin:/usr/local/teTeX/bin/powerpc-apple-darwin-
> current:/usr/X11R6/bin:/sw/bin:/opt/local/teTeX/bin
> Env var "PATH", "", is prepended with
> "/usr/bin:/usr/local/bin:/usr/local/teTeX/bin/powerpc-apple-darwin-
> current:/usr/X11R6/bin:/sw/bin:/opt/local/teTeX/bin"
> setEnvPath(PATH) == 1
> result:

So, the code thinks that all has worked successfully. Grrrrr.

Let's try and refine this. Do things work correctly if you use putenv 
rather than setenv? (Ie, maybe the problem lies with (our use of) gcc 
2.95's setenv routine.)

Could you alter this function in src/support/filetools.C? Do it in two 
steps. Ie, add (and use) the diagnostic below and secondly use the '#if 0' 
to bypass this block entirely and use the HAVE_PUTENV block.

 bool PutEnv(string const & envstr)
 {
         // CHECK Look at and fix this.
         // f.ex. what about error checking?

-#if defined (HAVE_SETENV)
+#if 0
         string name;
         string const value = split(envstr, name, '=');
         int const retval = ::setenv(name.c_str(), value.c_str(), true);
+        lyxerr << "PutEnv(" << envstr << ")\n"
+               << '\t' << name << '\n'
+               << '\t' << value << '\n'
+               << std::endl;
 #elif defined (HAVE_PUTENV)

Sorry about all this.

-- 
Angus

Reply via email to