diff options
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; |