diff options
author | Brad King <brad.king@kitware.com> | 2014-04-03 12:43:51 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-04-03 12:43:51 (GMT) |
commit | 23b4abb26082fbaec523ad48f4be54f55c11b58c (patch) | |
tree | 8f18daecdd3e7bdde88271fe56fbef48fa5b7693 /Source/kwsys/System.c | |
parent | 9f69a34f9990faefc28ac095fd874404cf07963b (diff) | |
parent | eccc425af6ffeb52963cc2dd94a36a24c271108b (diff) | |
download | CMake-23b4abb26082fbaec523ad48f4be54f55c11b58c.zip CMake-23b4abb26082fbaec523ad48f4be54f55c11b58c.tar.gz CMake-23b4abb26082fbaec523ad48f4be54f55c11b58c.tar.bz2 |
Merge branch 'upstream-kwsys' into update-kwsys
Diffstat (limited to 'Source/kwsys/System.c')
-rw-r--r-- | Source/kwsys/System.c | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/Source/kwsys/System.c b/Source/kwsys/System.c index 5d178bf..1ee26fa 100644 --- a/Source/kwsys/System.c +++ b/Source/kwsys/System.c @@ -353,6 +353,10 @@ static int kwsysSystem_Shell__GetArgumentSize(const char* in, if(kwsysSystem_Shell__ArgumentNeedsQuotes(in, isUnix, flags)) { /* Surrounding quotes are needed. Allocate space for them. */ + if((flags & kwsysSystem_Shell_Flag_WatcomQuote) && (isUnix)) + { + size += 2; + } size += 2; /* We must escape all ending backslashes when quoting on windows. */ @@ -377,7 +381,18 @@ static char* kwsysSystem_Shell__GetArgument(const char* in, char* out, if(needQuotes) { /* Add the opening quote for this argument. */ - *out++ = '"'; + if(flags & kwsysSystem_Shell_Flag_WatcomQuote) + { + if(isUnix) + { + *out++ = '"'; + } + *out++ = '\''; + } + else + { + *out++ = '"'; + } } /* Scan the string for characters that require escaping or quoting. */ @@ -549,7 +564,18 @@ static char* kwsysSystem_Shell__GetArgument(const char* in, char* out, } /* Add the closing quote for this argument. */ - *out++ = '"'; + if(flags & kwsysSystem_Shell_Flag_WatcomQuote) + { + *out++ = '\''; + if(isUnix) + { + *out++ = '"'; + } + } + else + { + *out++ = '"'; + } } /* Store a terminating null without incrementing. */ |