Browse Source

BUG: CollapseFullPath was calling SplitProgramPath before changing the working directory to in_base.

Brad King 22 years ago
parent
commit
f48941f261
1 changed files with 3 additions and 3 deletions
  1. 3 3
      Source/kwsys/SystemTools.cxx

+ 3 - 3
Source/kwsys/SystemTools.cxx

@@ -1318,9 +1318,6 @@ kwsys_stl::string SystemTools::CollapseFullPath(const char* in_relative)
 kwsys_stl::string SystemTools::CollapseFullPath(const char* in_relative,
                                             const char* in_base)
 {
-  kwsys_stl::string dir, file;
-  SystemTools::SplitProgramPath(in_relative, dir, file, false);
-  
   // Save original working directory.
   kwsys_stl::string orig = SystemTools::GetCurrentWorkingDirectory();
   
@@ -1330,6 +1327,9 @@ kwsys_stl::string SystemTools::CollapseFullPath(const char* in_relative,
     Chdir(in_base);
     }
   
+  kwsys_stl::string dir, file;
+  SystemTools::SplitProgramPath(in_relative, dir, file, false);
+  
 #ifdef _WIN32
   // Follow relative path.
   if(!(dir == ""))