diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-11-21 09:18:04 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-11-21 09:18:04 (GMT) |
commit | b89b27df4236a887798a52aadfb9f9641631b5dd (patch) | |
tree | 899039842cfd3a8a1049516091edc2a389c6d76e /library/tcltest | |
parent | 8422ebbd589e66f37e18e023a950a9d5eb23acd6 (diff) | |
download | tcl-b89b27df4236a887798a52aadfb9f9641631b5dd.zip tcl-b89b27df4236a887798a52aadfb9f9641631b5dd.tar.gz tcl-b89b27df4236a887798a52aadfb9f9641631b5dd.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/tcltest')
-rw-r--r-- | library/tcltest/tcltest.tcl | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/library/tcltest/tcltest.tcl b/library/tcltest/tcltest.tcl index d066a1b..4b94312 100644 --- a/library/tcltest/tcltest.tcl +++ b/library/tcltest/tcltest.tcl @@ -2495,14 +2495,6 @@ proc tcltest::cleanupTests {{calledFromAllFile 0}} { set changedEnv {} set removedEnv {} foreach index [array names ::env] { - if {[info exists originalEnv($index)]} { - if {$::env($index) != $originalEnv($index)} { - lappend changedEnv $index - set ::env($index) $originalEnv($index) - } - } - } - foreach index [array names ::env] { if {![info exists originalEnv($index)]} { lappend newEnv $index unset ::env($index) @@ -2512,6 +2504,9 @@ proc tcltest::cleanupTests {{calledFromAllFile 0}} { if {![info exists ::env($index)]} { lappend removedEnv $index set ::env($index) $originalEnv($index) + } elseif {$::env($index) ne $originalEnv($index)} { + lappend changedEnv $index + set ::env($index) $originalEnv($index) } } if {[llength $newEnv] > 0} { |