Просмотр исходного кода

BUG: Added hack to cmSystemTools::GetPath to make its algorithm correctly parse off the last entry of the system PATH environment variable.

Brad King 24 лет назад
Родитель
Сommit
ad2437f08c
1 измененных файлов с 5 добавлено и 0 удалено
  1. 5 0
      Source/cmSystemTools.cxx

+ 5 - 0
Source/cmSystemTools.cxx

@@ -90,6 +90,11 @@ void cmSystemTools::GetPath(std::vector<std::string>& path)
   const char* pathSep = ":";
   const char* pathSep = ":";
 #endif
 #endif
   std::string pathEnv = getenv("PATH");
   std::string pathEnv = getenv("PATH");
+  // A hack to make the below algorithm work.  
+  if(pathEnv[pathEnv.length()-1] != ':')
+    {
+    pathEnv += ":";  
+    }
   std::string::size_type start =0;
   std::string::size_type start =0;
   bool done = false;
   bool done = false;
   while(!done)
   while(!done)