diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-11-21 09:24:59 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-11-21 09:24:59 (GMT) |
commit | c8f1a349c0232b2ae689b4fb2975837db0569661 (patch) | |
tree | d34a7e05781d7862cf2f193fe9488c59c475846a /library/init.tcl | |
parent | d34df50ace1499cffc3ac40f2afbca4421ffc023 (diff) | |
parent | b89b27df4236a887798a52aadfb9f9641631b5dd (diff) | |
download | tcl-c8f1a349c0232b2ae689b4fb2975837db0569661.zip tcl-c8f1a349c0232b2ae689b4fb2975837db0569661.tar.gz tcl-c8f1a349c0232b2ae689b4fb2975837db0569661.tar.bz2 |
The only relyable way of changing environment variables to uppercase (e.g. env(ComSpec) to env(COMSPEC)) is unsetting the old one first. Long-standing bug, exposed by [219226].
Diffstat (limited to 'library/init.tcl')
-rw-r--r-- | library/init.tcl | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/library/init.tcl b/library/init.tcl index 1ca6413..f63eedf 100644 --- a/library/init.tcl +++ b/library/init.tcl @@ -130,9 +130,9 @@ if {(![interp issafe]) && ($tcl_platform(platform) eq "windows")} { switch -- $u { COMSPEC - PATH { - if {![info exists env($u)]} { - set env($u) $env($p) - } + set temp $env($p) + unset env($p) + set env($u) $temp trace add variable env($p) write \ [namespace code [list EnvTraceProc $p]] trace add variable env($u) write \ @@ -142,11 +142,7 @@ if {(![interp issafe]) && ($tcl_platform(platform) eq "windows")} { } } if {![info exists env(COMSPEC)]} { - if {$tcl_platform(os) eq "Windows NT"} { - set env(COMSPEC) cmd.exe - } else { - set env(COMSPEC) command.com - } + set env(COMSPEC) cmd.exe } } InitWinEnv |