diff options
author | Brad King <brad.king@kitware.com> | 2008-04-30 19:58:45 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-04-30 19:58:45 (GMT) |
commit | 16ec04c2a7ed80fc10cbc731ef3f7646b5fe6b1a (patch) | |
tree | 468ed480667295bd18694cabe05b70af42d37601 /Source/kwsys/System.c | |
parent | 637596a157bba8a18ee51ca0c7dc27df278c8596 (diff) | |
download | CMake-16ec04c2a7ed80fc10cbc731ef3f7646b5fe6b1a.zip CMake-16ec04c2a7ed80fc10cbc731ef3f7646b5fe6b1a.tar.gz CMake-16ec04c2a7ed80fc10cbc731ef3f7646b5fe6b1a.tar.bz2 |
BUG: Fix escaping of more characters on Windows shells.
Diffstat (limited to 'Source/kwsys/System.c')
-rw-r--r-- | Source/kwsys/System.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/Source/kwsys/System.c b/Source/kwsys/System.c index 3908c05..d205c96 100644 --- a/Source/kwsys/System.c +++ b/Source/kwsys/System.c @@ -75,6 +75,13 @@ static int kwsysSystem_Shell__CharNeedsQuotesOnUnix(char c) } /*--------------------------------------------------------------------------*/ +static int kwsysSystem_Shell__CharNeedsQuotesOnWindows(char c) +{ + return ((c == '\'') || (c == '#') || (c == '&') || + (c == '<') || (c == '>') || (c == '|') || (c == '^')); +} + +/*--------------------------------------------------------------------------*/ static int kwsysSystem_Shell__CharNeedsQuotes(char c, int isUnix, int flags) { /* On Windows the built-in command shell echo never needs quotes. */ @@ -99,14 +106,10 @@ static int kwsysSystem_Shell__CharNeedsQuotes(char c, int isUnix, int flags) } else { - /* On Windows single-quotes must be escaped in some make - environments, such as in mingw32-make. */ - if(flags & kwsysSystem_Shell_Flag_Make) + /* On Windows several special characters need quotes to preserve them. */ + if(kwsysSystem_Shell__CharNeedsQuotesOnWindows(c)) { - if(c == '\'') - { - return 1; - } + return 1; } } return 0; |