OSDN Git Service

2009-04-01 H.J. Lu <hongjiu.lu@intel.com>
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 1 Apr 2009 12:36:21 +0000 (12:36 +0000)
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 1 Apr 2009 12:36:21 +0000 (12:36 +0000)
(restore_ld_library_path_env_vars): Always restore GCC_EXEC_PREFIX
to its original value, or unset if it was not defined.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145400 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/lib/target-libpath.exp

index 6e723c3..ee6dbb5 100644 (file)
@@ -1,3 +1,8 @@
+2009-04-01  H.J. Lu  <hongjiu.lu@intel.com>
+
+       (restore_ld_library_path_env_vars): Always restore GCC_EXEC_PREFIX
+       to its original value, or unset if it was not defined.
+
 2009-03-31  Jason Merrill  <jason@redhat.com>
 
        * g++.old-deja/g++.other/using9.C: Add expected errors.
index c95cba6..6a01d94 100644 (file)
@@ -213,16 +213,16 @@ proc restore_ld_library_path_env_vars { } {
   global orig_gcc_exec_prefix
   global env
 
-  if { $orig_environment_saved == 0 } {
-    return
-  }
-
   if { $orig_gcc_exec_prefix_saved } {
     setenv GCC_EXEC_PREFIX "$orig_gcc_exec_prefix"
   } elseif [info exists env(GCC_EXEC_PREFIX)] {
     unsetenv GCC_EXEC_PREFIX
   }
 
+  if { $orig_environment_saved == 0 } {
+    return
+  }
+
   if { $orig_ld_library_path_saved } {
     setenv LD_LIBRARY_PATH "$orig_ld_library_path"
   } elseif [info exists env(LD_LIBRARY_PATH)] {