Explorar o código

BUG: fix for network paths

Berk Geveci %!s(int64=24) %!d(string=hai) anos
pai
achega
31561a7848
Modificáronse 1 ficheiros con 6 adicións e 3 borrados
  1. 6 3
      Source/cmSystemTools.cxx

+ 6 - 3
Source/cmSystemTools.cxx

@@ -504,10 +504,13 @@ const char *cmSystemTools::ConvertToWindowsSlashesAndCleanUp(std::string& path)
 {
 {
   cmSystemTools::ConvertToWindowsSlashes(path);
   cmSystemTools::ConvertToWindowsSlashes(path);
   std::string::size_type pos = 0;
   std::string::size_type pos = 0;
-  pos = 0;
-  while((pos = path.find("\\\\", pos)) != std::string::npos)
+  if(path.size() > 1)
     {
     {
-    path.erase(pos, 1);
+      pos = 1;
+      while((pos = path.find("\\\\", pos)) != std::string::npos)
+	{
+	  path.erase(pos, 1);
+	}
     }
     }
   return path.c_str();
   return path.c_str();
 }
 }