]> git.ipfire.org Git - thirdparty/make.git/commitdiff
Revert "[SV 56449] (Windows) Use slow path if '%' appears in the command"
authorEli Zaretskii <eliz@gnu.org>
Tue, 10 Sep 2019 16:09:39 +0000 (19:09 +0300)
committerEli Zaretskii <eliz@gnu.org>
Tue, 10 Sep 2019 16:09:39 +0000 (19:09 +0300)
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.

src/job.c

index 115d8481d2f0b08d3def032ea2603cbd3e3bd067..92d48bc5c88f7418afe0ad2c212062d55f91be88 100644 (file)
--- 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;