Fix treatment of whitespace after a backslash on MS-Windows.
authorEli Zaretskii <eliz@gnu.org>
Wed, 1 May 2013 15:31:53 +0000 (18:31 +0300)
committerEli Zaretskii <eliz@gnu.org>
Wed, 1 May 2013 15:31:53 +0000 (18:31 +0300)
 job.c (construct_command_argv_internal): Don't treat a backslash as an
 escape character before whitespace, if the shell is not a Posix
 shell.   For the description of the problem, see
 http://lists.gnu.org/archive/html/make-w32/2013-04/msg00014.html.

ChangeLog
job.c

index cfd59f79503ebc06915879000ea0538d2cb53ffb..e8033d6f01231dd0e1c2a19f39283ce0b0aeaae8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,10 @@
 
        * job.c (start_job_command) [WINDOWS32]: Make the same fix for
        MS-Windows as the previous commit did for Posix platforms.
+       (construct_command_argv_internal): Don't treat a backslash as an
+       escape character before whitespace, if the shell is not a Posix
+       shell.   For the description of the problem, see
+       http://lists.gnu.org/archive/html/make-w32/2013-04/msg00014.html.
 
 2013-05-01  Paul Smith  <psmith@gnu.org>
 
diff --git a/job.c b/job.c
index 5b626b15e3108d334a009016f55484eb25fe1ccb..b245007a05aca1191d257f9fffe59dc24794a601 100644 (file)
--- a/job.c
+++ b/job.c
@@ -3076,6 +3076,15 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
                 if (ap == new_argv[i])
                   p = next_token (p + 1) - 1;
              }
+#ifdef WINDOWS32
+           /* Backslash before whitespace is not special if our shell
+              is not Unixy.  */
+           else if (isspace (p[1]) && !unixy_shell)
+             {
+               *ap++ = *p;
+               break;
+             }
+#endif
            else if (p[1] != '\0')
               {
 #ifdef HAVE_DOS_PATHS