summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/System.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2007-05-17 18:01:02 (GMT)
committerBrad King <brad.king@kitware.com>2007-05-17 18:01:02 (GMT)
commit5e1dd6fb518bebccf6aa32788000e0c907d2132a (patch)
treeb7fd2d607de264ec24727dadf411a9c1edc792af /Source/kwsys/System.c
parentf41e1f496c203a3f45d3e242f850e4f52fdb635d (diff)
downloadCMake-5e1dd6fb518bebccf6aa32788000e0c907d2132a.zip
CMake-5e1dd6fb518bebccf6aa32788000e0c907d2132a.tar.gz
CMake-5e1dd6fb518bebccf6aa32788000e0c907d2132a.tar.bz2
BUG: Some single-character arguments need quoting on windows.
Diffstat (limited to 'Source/kwsys/System.c')
-rw-r--r--Source/kwsys/System.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/Source/kwsys/System.c b/Source/kwsys/System.c
index 0446b79..289be3e 100644
--- a/Source/kwsys/System.c
+++ b/Source/kwsys/System.c
@@ -50,6 +50,15 @@ just NOT quote them and let the listfile author deal with it.
*/
+/*
+TODO: For windows echo:
+
+To display a pipe (|) or redirection character (< or >) when using the
+echo command, use a caret character immediately before the pipe or
+redirection character (for example, ^>, ^<, or ^| ). If you need to
+use the caret character itself (^), use two in a row (^^).
+*/
+
/*--------------------------------------------------------------------------*/
static int kwsysSystem_Shell__CharIsWhitespace(char c)
{
@@ -159,6 +168,7 @@ static int kwsysSystem_Shell__ArgumentNeedsQuotes(const char* in, int isUnix,
int flags)
{
/* Scan the string for characters that require quoting. */
+ {
const char* c;
for(c=in; *c; ++c)
{
@@ -191,6 +201,18 @@ static int kwsysSystem_Shell__ArgumentNeedsQuotes(const char* in, int isUnix,
return 1;
}
}
+ }
+
+ /* On Windows some single character arguments need quotes. */
+ if(!isUnix && *in && !*(in+1))
+ {
+ char c = *in;
+ if((c == '?') || (c == '&') || (c == '^') || (c == '|') || (c == '#'))
+ {
+ return 1;
+ }
+ }
+
return 0;
}