diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2002-02-22 20:40:44 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2002-02-22 20:40:44 (GMT) |
commit | b8d2413156333bc5917319dc6de1ca07a8fb3897 (patch) | |
tree | c34f85dc235879b5c8bc06297022a75dee756a82 /Source/cmSystemTools.cxx | |
parent | 8c3400dc6b61cc8bd524ca4f53dc0ef2d6eb6ef1 (diff) | |
download | CMake-b8d2413156333bc5917319dc6de1ca07a8fb3897.zip CMake-b8d2413156333bc5917319dc6de1ca07a8fb3897.tar.gz CMake-b8d2413156333bc5917319dc6de1ca07a8fb3897.tar.bz2 |
ENH: fix for spaces in paths on unix
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r-- | Source/cmSystemTools.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 200889a..3e4efc6 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -441,13 +441,16 @@ std::string cmSystemTools::ConvertToUnixOutputPath(const char* path) if(ret.find(" ") != std::string::npos) { std::string result = ""; + char lastch = 1; for(const char* ch = ret.c_str(); *ch != '\0'; ++ch) { - if(*ch == ' ') + // if it is already escaped then don't try to escape it again + if(*ch == ' ' && lastch != '\\') { result += '\\'; } result += *ch; + lastch = *ch; } ret = result; } |