BUG: Fix escaping of more characters on Windows shells.

This commit is contained in:
Brad King
2008-04-30 15:58:45 -04:00
parent 637596a157
commit 16ec04c2a7
2 changed files with 31 additions and 20 deletions
+10 -7
View File
@@ -74,6 +74,13 @@ static int kwsysSystem_Shell__CharNeedsQuotesOnUnix(char c)
(c == '*') || (c == '^') || (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)
{
@@ -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;