summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/System.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-04-03 12:43:51 (GMT)
committerBrad King <brad.king@kitware.com>2014-04-03 12:43:51 (GMT)
commit23b4abb26082fbaec523ad48f4be54f55c11b58c (patch)
tree8f18daecdd3e7bdde88271fe56fbef48fa5b7693 /Source/kwsys/System.c
parent9f69a34f9990faefc28ac095fd874404cf07963b (diff)
parenteccc425af6ffeb52963cc2dd94a36a24c271108b (diff)
downloadCMake-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.c30
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. */