summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/SystemTools.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2006-08-11 13:56:39 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2006-08-11 13:56:39 (GMT)
commitfd56f7247a5689200e66dbc3d0dc7afbbca13d75 (patch)
treef4c470d29ec9d521ee2bd6aed0aa27f37c9c02f7 /Source/kwsys/SystemTools.cxx
parent560a4371a73102386cfe748c44efa4119f646818 (diff)
downloadCMake-fd56f7247a5689200e66dbc3d0dc7afbbca13d75.zip
CMake-fd56f7247a5689200e66dbc3d0dc7afbbca13d75.tar.gz
CMake-fd56f7247a5689200e66dbc3d0dc7afbbca13d75.tar.bz2
ENH: escape ( and ) in unix paths
Diffstat (limited to 'Source/kwsys/SystemTools.cxx')
-rw-r--r--Source/kwsys/SystemTools.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index 7c0242c..f4071d7 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -1367,14 +1367,14 @@ kwsys_stl::string SystemTools::ConvertToUnixOutputPath(const char* path)
ret.erase(pos, 1);
}
// now escape spaces if there is a space in the path
- if(ret.find(" ") != kwsys_stl::string::npos)
+ if(ret.find_first_of(" ()") != kwsys_stl::string::npos)
{
kwsys_stl::string result = "";
char lastch = 1;
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 == ' ' && lastch != '\\')
+ if((*ch == ' ' || *ch == '(' || *ch == ')') && lastch != '\\')
{
result += '\\';
}