summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/SystemTools.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/kwsys/SystemTools.cxx')
-rw-r--r--Source/kwsys/SystemTools.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index f445c8e..f6826ac 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -708,7 +708,14 @@ void SystemTools::ConvertToUnixSlashes(kwsys_stl::string& path)
kwsys_stl::string::size_type pos = 0;
while((pos = path.find('\\', pos)) != kwsys_stl::string::npos)
{
- path[pos] = '/';
+ // make sure we don't convert an escaped space to a unix slash
+ if(pos < path.size()-2)
+ {
+ if(path[pos+1] != ' ')
+ {
+ path[pos] = '/';
+ }
+ }
pos++;
}
// Remove all // from the path just like most unix shells