Tcl Source Code

Artifact [1a46f76340]
Login

Artifact 1a46f763405db0acb377ca5ab148afb728770392:

Attachment "1409272.patch" to ticket [1409272fff] added by dgp 2006-03-21 22:33:44.
Index: tests/env.test
===================================================================
RCS file: /cvsroot/tcl/tcl/tests/env.test,v
retrieving revision 1.25
diff -u -r1.25 env.test
--- tests/env.test	21 Mar 2006 14:33:24 -0000	1.25
+++ tests/env.test	21 Mar 2006 15:28:30 -0000
@@ -103,24 +103,18 @@
 # Save the current environment variables at the start of the test.
 
 foreach name [array names env] {
-    set env2([string toupper $name]) $env($name)
-    unset env($name)
-}
+    set env2($name) $env($name)
 
-# Added the following lines so that child tcltest can actually find its
-# library if the initial tcltest is run from a non-standard place.
-# ('saved' env vars)
-foreach name {
-    TCL_LIBRARY PATH LD_LIBRARY_PATH LIBPATH DISPLAY SHLIB_PATH
-    DYLD_LIBRARY_PATH DYLD_FRAMEWORK_PATH SYSTEMDRIVE SYSTEMROOT
-} {
-    if {[info exists env2($name)]} {
-	set env($name) $env2($name);
+    # Keep some environment variables that support operation of the
+    # tcltest package.
+    if {[string toupper $name] ni {
+	    TCL_LIBRARY PATH LD_LIBRARY_PATH LIBPATH DISPLAY SHLIB_PATH
+	    DYLD_LIBRARY_PATH DYLD_FRAMEWORK_PATH SYSTEMDRIVE SYSTEMROOT
+    }} {
+	unset env($name)
     }
 }
 
-#array set env [array get env2 S*]
-
 test env-2.1 {adding environment variables} {exec} {
     getenv
 } {}