From fd56f7247a5689200e66dbc3d0dc7afbbca13d75 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Fri, 11 Aug 2006 09:56:39 -0400 Subject: [PATCH] ENH: escape ( and ) in unix paths --- Source/kwsys/SystemTools.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index 7c0242c5c5..f4071d77f3 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 += '\\'; }