This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Environment passing bug?


On 2/21/2012 4:50 AM, Corinna Vinschen wrote:
> On Feb 20 18:06, Charles Wilson wrote:
>> I've observed different behavior with cygwin-1.7.0 on 64bit XP, and
>> 32bit XP (I'll check Vista-32 and W7-64 later tonight).  Using the
>> following attached win32 program:
>>
>> $ i686-pc-mingw32-gcc -o envprint envprint.c
>>
>> ====== xp-64 ========
>> $ uname -a
>> CYGWIN_NT-5.2-WOW64 abcdefgh 1.7.10(0.259/5/3) 2012-02-05 12:36 i686 Cygwin
>>
>> $ ./envprint | grep -i temp
>> 'TEMP=C:\cygwin\tmp'
>> ====== xp-64 ========
>>
>>
>>
>> ====== xp-32 ========
>> $ uname -a
>> CYGWIN_NT-5.1 ijklmnopq 1.7.10(0.259/5/3) 2012-02-05 12:36 i686 Cygwin
>>
>> $ ./envprint | grep -i temp
>> 'TEMP=C:\cygwin\tmp'
>> 'temp=C:\TEMP'
>> 'tmp=C:\TEMP'
>> ====== xp-32 ========
> 
> What I'm missing here is the information how the environment looks
> like in terms of the TMP/TEMP variables *before* calling envprint.
> Without this the testcase is rather incomplete.
> 
> For testing I did
> 
>   tcsh$ setenv TEMP /tmp
>   tcsh$ setenv TMP /tmp
>   tcsh$ ./envprint | grep -i tmp
>   'TEMP=C:\cygwin\tmp'
>   'TMP=C:\cygwin\tmp'
> 
> same result on 32 bit W7 and 64 bit W2K8R2.

Ah -- well, in both cases I have the same settings in the Windows
Environment, and <strikeout>am using the stock /etc/profile files to set
those values.</strikeout> So, from the cygwin standpoint:

====== xp-64 ========
$ printf "'%s'\n'%s'\n'%s'\n'%s'\n'%s'\n'%s'\n" "$TEMP" "$TMP" "$TMPDIR"
$temp $tmp $tmpdir
'/tmp'
'/tmp'
''
''
''
''
====== xp-64 ========

====== xp-32 ========
'/tmp'
'/tmp'
''
'C:\TEMP'
'C:\TEMP'
''
====== xp-32 ========

Well, now...that's odd.  Oh, here it is -- my /etc/profile on the 64bit
machine is NOT in sync with the /etc/defaults version, while on the
32bit machine the "real" profile matches the "defaults" copy.

$ diff /etc/defaults/etc/profile /etc/profile|diffstat
 unknown |   71
++++++++++++++++++++++++----------------------------------------

Looks like I edited it sometime during 4.0-4...

< # base-files version 4.0-9
---
> # base-files version 4.0-4


So...at least now I can establish that, using *current* /etc stuff, I
get the same behavior on 64 as on 32:

====== xp-64 ========
$ printf "'%s'\n'%s'\n'%s'\n'%s'\n'%s'\n'%s'\n" "$TEMP" "$TMP" "$TMPDIR"
$temp $tmp $tmpdir
'/tmp'
'/tmp'
''
'C:\Temp'
'C:\Temp'
''

$ ./envprint.exe  | grep -i temp
'TEMP=C:\cygwin\tmp'
'temp=C:\Temp'
'tmp=C:\Temp'
====== xp-64 ========

...and the only mystery now is how my $ATWORK stuff should deal with the
fact that there are TWO different copies of the "same" variable in the
environment, if the $TESTAPP is started from cygwin rather than plan old
dosbox.

...or, is it possible that cygwin should not export both copies of
TEMP/temp, TMP/tmp when spawning a native process?

--
Chuck

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]