浏览代码

BUG: fix for network paths

Berk Geveci 24 年之前
父节点
当前提交
31561a7848
共有 1 个文件被更改,包括 6 次插入3 次删除
  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);
   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();
 }