From: Christian Eggers Date: Thu, 6 Jun 2019 10:42:38 +0000 (+0200) Subject: [SV 56449] (Windows) Use slow path if '%' appears in the command X-Git-Tag: 4.2.90~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=38e96eadea6e2cd42a0f414959bac327de9f468a;p=thirdparty%2Fmake.git [SV 56449] (Windows) Use slow path if '%' appears in the command * src/job.c (sh_chars_dos): Add '%' as a special character * src/job.c (construct_command_argv_internal): Check for '%' in quotes For the windows version of make, a recipe line cannot be executed diretly by make (without a shell) if a '%' character is present. This character starts a cmd.exe escape sequence. Signed-off-by: Christian Eggers Copyright-paperwork-exempt: yes --- diff --git a/src/job.c b/src/job.c index 54dd284f..1df329ee 100644 --- a/src/job.c +++ b/src/job.c @@ -2660,7 +2660,7 @@ construct_command_argv_internal (char *line, char **restp, const char *shell, can handle quoted file names just fine, removing the quote lifts the limit from a very frequent use case, because using quoted file names is commonplace on MS-Windows. */ - static const char *sh_chars_dos = "|&<>"; + static const char *sh_chars_dos = "|&<>%"; static const char *sh_cmds_dos[] = { "assoc", "break", "call", "cd", "chcp", "chdir", "cls", "color", "copy", "ctty", "date", "del", "dir", "echo", "echo.", "endlocal", "erase", @@ -2861,9 +2861,9 @@ construct_command_argv_internal (char *line, char **restp, const char *shell, else if (instring == '"' && strchr ("\\$`", *p) != 0 && unixy_shell) goto slow; #ifdef WINDOWS32 - /* Quoted wildcard characters must be passed quoted to the + /* Quoted wildcard and % characters must be passed quoted to the command, so give up the fast route. */ - else if (instring == '"' && strchr ("*?", *p) != 0 && !unixy_shell) + else if (instring == '"' && strchr ("*?%", *p) != 0 && !unixy_shell) goto slow; else if (instring == '"' && strncmp (p, "\\\"", 2) == 0) *ap++ = *++p;