summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/SystemTools.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2007-02-22 02:24:17 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2007-02-22 02:24:17 (GMT)
commit5647e6e254f82a81997cd3913f872b06fe761f1e (patch)
tree50022ba8365b2c196965087a23a86cb848e36302 /Source/kwsys/SystemTools.cxx
parent806001bbb633a27624e9a0f5e564cab3bfefb0c3 (diff)
downloadCMake-5647e6e254f82a81997cd3913f872b06fe761f1e.zip
CMake-5647e6e254f82a81997cd3913f872b06fe761f1e.tar.gz
CMake-5647e6e254f82a81997cd3913f872b06fe761f1e.tar.bz2
ENH: fix parens in the path with spaces in the path
Diffstat (limited to 'Source/kwsys/SystemTools.cxx')
-rw-r--r--Source/kwsys/SystemTools.cxx19
1 files changed, 3 insertions, 16 deletions
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index f75a39d..0d6700a 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -1414,7 +1414,7 @@ kwsys_stl::string SystemTools::ConvertToUnixOutputPath(const char* path)
ret.erase(pos, 1);
}
// escape spaces and () in the path
- if(ret.find_first_of(" ()") != kwsys_stl::string::npos)
+ if(ret.find_first_of(" ") != kwsys_stl::string::npos)
{
kwsys_stl::string result = "";
char lastch = 1;
@@ -1422,22 +1422,9 @@ kwsys_stl::string SystemTools::ConvertToUnixOutputPath(const char* path)
for(const char* ch = ret.c_str(); *ch != '\0'; ++ch)
{
// if it is already escaped then don't try to escape it again
- if((*ch == ' ' || *ch == '(' || *ch == ')') && lastch != '\\')
+ if((*ch == ' ') && lastch != '\\')
{
- if(*ch == '(' && lastch == '$')
- {
- inDollarVariable = true;
- }
- // if we are in a $(..... and we get a ) then do not escape
- // the ) and but set inDollarVariable to false
- else if(*ch == ')' && inDollarVariable)
- {
- inDollarVariable = false;
- }
- else
- {
- result += '\\';
- }
+ result += '\\';
}
result += *ch;
lastch = *ch;