summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/System.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-10-04 22:52:24 (GMT)
committerBrad King <brad.king@kitware.com>2006-10-04 22:52:24 (GMT)
commit038c9e27d78b2df56460c85a1a797c7e0dc3e149 (patch)
tree842bf9339e01ef6a38c8370c24141dd96ad8ce1d /Source/kwsys/System.c
parent5a6b0792cd5b3dd16b8a94091db15e02e9b4a00b (diff)
downloadCMake-038c9e27d78b2df56460c85a1a797c7e0dc3e149.zip
CMake-038c9e27d78b2df56460c85a1a797c7e0dc3e149.tar.gz
CMake-038c9e27d78b2df56460c85a1a797c7e0dc3e149.tar.bz2
ENH: Adding Shell_Flag_EchoWindows option to setup escapes for arguments to the native echo command in a shell. This special case is needed to avoid adding quotes when passing text to echo in a native windows shell which does no command line parsing at all.
Diffstat (limited to 'Source/kwsys/System.c')
-rw-r--r--Source/kwsys/System.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/Source/kwsys/System.c b/Source/kwsys/System.c
index 414e69c..33e1149 100644
--- a/Source/kwsys/System.c
+++ b/Source/kwsys/System.c
@@ -66,6 +66,12 @@ static int kwsysSystem_Shell__CharNeedsQuotesOnUnix(char c)
/*--------------------------------------------------------------------------*/
static int kwsysSystem_Shell__CharNeedsQuotes(char c, int isUnix, int flags)
{
+ /* On Windows the built-in command shell echo never needs quotes. */
+ if(!isUnix && (flags & kwsysSystem_Shell_Flag_EchoWindows))
+ {
+ return 0;
+ }
+
/* On all platforms quotes are needed to preserve whitespace. */
if(kwsysSystem_Shell__CharIsWhitespace(c))
{
@@ -227,6 +233,10 @@ static int kwsysSystem_Shell__GetArgumentSize(const char* in,
++size;
}
}
+ else if(flags & kwsysSystem_Shell_Flag_EchoWindows)
+ {
+ /* On Windows the built-in command shell echo never needs escaping. */
+ }
else
{
/* On Windows only backslashes and double-quotes need escaping. */
@@ -334,6 +344,10 @@ static char* kwsysSystem_Shell__GetArgument(const char* in, char* out,
*out++ = '\\';
}
}
+ else if(flags & kwsysSystem_Shell_Flag_EchoWindows)
+ {
+ /* On Windows the built-in command shell echo never needs escaping. */
+ }
else
{
/* On Windows only backslashes and double-quotes need escaping. */