From 31561a7848d8c2b81ab2bc269e4b2c7e190402a7 Mon Sep 17 00:00:00 2001 From: Berk Geveci Date: Thu, 24 Jan 2002 14:15:49 -0500 Subject: [PATCH] BUG: fix for network paths --- Source/cmSystemTools.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index b5add2cef..ff61100a0 100644 --- a/Source/cmSystemTools.cxx +++ b/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(); }