2012-12-07 Eli Zaretskii <eliz@gnu.org>
+ * job.c (construct_command_argv_internal): Remove " from
+ sh_chars_dos[]. Ignore an escaped backslash inside a string
+ quoted with "..". This lifts the 4KB or 8KB command-line length
+ limitation imposed by the Windows shell when a command uses quoted
+ strings, because we now don't call the shell in that case.
+
* job.c (create_batch_file): Declare the counter of batch files
static, to avoid having 2 jobs using the same file name and
stepping on each other's toes. When all 64K names are used up,
"unset", "unsetenv", "version",
0 };
#elif defined (WINDOWS32)
- static char sh_chars_dos[] = "\"|&<>";
+ /* We used to have a double quote (") in sh_chars_dos[] below, but
+ that caused any command line with quoted file names be run
+ through a temporary batch file, which introduces command-line
+ limit of 4K charcaters imposed by cmd.exe. Since CreateProcess
+ 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 char sh_chars_dos[] = "|&<>";
static char *sh_cmds_dos[] = { "assoc", "break", "call", "cd", "chcp",
"chdir", "cls", "color", "copy", "ctty",
"date", "del", "dir", "echo", "echo.",
quotes have the same effect. */
else if (instring == '"' && strchr ("\\$`", *p) != 0 && unixy_shell)
goto slow;
+#ifdef WINDOWS32
+ else if (instring == '"' && strncmp (p, "\\\"", 2) == 0)
+ *ap++ = *++p;
+#endif
else
*ap++ = *p;
}