Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2005-11-04
04:56 • Ticket [502197ffff] SetEnvironmentVariable() currupts list status still Open... artifact: ec96764fff user: davygrvy
2005-10-05
15:10 • Ticket [502197ffff]: 4 changes artifact: 9890212484 user: hobbs
2004-01-15
16:19 • Ticket [502197ffff]: 4 changes artifact: cf754f6f28 user: davygrvy
15:58 • Ticket [502197ffff]: 4 changes artifact: bc38e7934f user: davygrvy
15:57 • Ticket [502197ffff]: 4 changes artifact: cfbca79423 user: davygrvy
15:57 • Add attachment test.c to ticket [502197ffff] artifact: 89886687e9 user: davygrvy
2004-01-03
16:39 • Open ticket [502197ffff]: SetEnvironmentVariable() currupts list plus 7 othe... artifact: a4b14b5091 user: davygrvy
2002-02-26
05:16 • Ticket [502197ffff]: 6 changes artifact: 93f08e7646 user: davygrvy
05:09 • Closed ticket [502197ffff]. artifact: d6820fa270 user: hobbs
2002-01-11
05:42 • New ticket [502197ffff]. artifact: 1435d4aa38 user: davygrvy

SetEnvironmentVariable() currupts list

Open502197ffffffffffffffffffffffffffffffffffCreated 25 years agoUpdated 21 years ago
Descriptionplain2002-01-11 05:42:31
Win32 specific!

Use of SetEnvironmentVariable() by an extension or an 
application that embeds Tcl, puts the libc maintained 
environ list out-of-sync.  This in turn puts Tcl's env 
array out-of-sync as well.
hobbsplain2002-02-26 05:09:16
Logged In: YES 
user_id=72656

This is why Tcl has the Tcl_PutEnv compatibility procedure 
for extension authors to use to keep in sync.
davygrvyplain2002-02-26 05:16:32
Logged In: YES 
user_id=7549

but in places where this is out of your control, 
GetEnvironmentStrings() more accurately represents what the 
OS maintains.
davygrvyplain2004-01-03 16:39:34
Logged In: YES 
user_id=7549

This is not fixed, nor invalid.  reopening.
davygrvyplain2004-01-15 15:57:59
Logged In: YES 
user_id=7549

writing sync problems:

% tsetenv FOO baz
% wgetenv FOO
baz
% set env(FOO)
baz
% getenv FOO                          <- blank return
% wsetenv FOO pickle
% set env(FOO)
baz
% getenv FOO
%

reading sync prolems:

% set env(TEST) first
first
% load test
% set env(TEST) second
second
% getenv TEST
first
% wgetenv TEST
second
% tgetenv TEST
second
davygrvyplain2004-01-15 15:58:00
File Added - 73512: test.c
davygrvyplain2004-01-15 16:19:41
Logged In: YES 
user_id=7549

Just this, and everyone has the wrong answer:

% getenv FOO
% setenv FOO qwe
% set env(FOO)
baz
% wgetenv FOO
qwe
% tgetenv FOO
baz
% wsetenv FOO asd             <- system
% tgetenv FOO
baz                           <- tcl
% getenv FOO
qwe                           <- c-runtime
%
hobbsplain2005-10-05 15:10:19
Logged In: YES 
user_id=72656

Hmmm, I just corrected this for unix with 979640.  I'm not
sure how related they are, as we rely on putenv solely for
Windows.
davygrvy Ticket [502197ffff]: 1 change [History diff]2005-11-04 04:56:05
Log in (anonymous is fine) to add a comment.

Attachments: