From: Eli Zaretskii Date: Tue, 10 Sep 2019 16:09:39 +0000 (+0300) Subject: Revert "[SV 56449] (Windows) Use slow path if '%' appears in the command" X-Git-Tag: 4.2.91~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=271e572ba2f16f8d5b1d45c768bdec060073c279;p=thirdparty%2Fmake.git Revert "[SV 56449] (Windows) Use slow path if '%' appears in the command" This reverts commit 38e96eadea6e2cd42a0f414959bac327de9f468a. Per discussion on Savannah, the modified behavior matches the way % is handled in batch files, but not in cmd command lines. And since Make mostly tries to emulate the command line, the new behavior is unexpected and backward-incompatible. --- diff --git a/src/job.c b/src/job.c index 115d8481..92d48bc5 100644 --- a/src/job.c +++ b/src/job.c @@ -2748,7 +2748,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", @@ -2949,9 +2949,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 and % characters must be passed quoted to the + /* Quoted wildcard 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;