Fix the .ONESHELL operation on MS-Windows.
authorEli Zaretskii <eliz@gnu.org>
Mon, 29 Apr 2013 16:17:07 +0000 (19:17 +0300)
committerEli Zaretskii <eliz@gnu.org>
Mon, 29 Apr 2013 16:17:07 +0000 (19:17 +0300)
 job.c (construct_command_argv_internal) [WINDOWS32]: Return
 right after generating new_argv for one_shell case.  This fixes
 the Windows build for both Unixy shell and stock Windows shells.

ChangeLog
job.c

index edf30c3ccef920805abf204a736b47f02c2f8c10..e297795dc3b8b5993d379ff3dbf0e5475c638628 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-04-29  Eli Zaretskii  <eliz@gnu.org>
+
+       * job.c (construct_command_argv_internal) [WINDOWS32]: Return
+       right after generating new_argv for one_shell case.  This fixes
+       the Windows build for both Unixy shell and stock Windows shells.
+
 2013-04-28  Eli Zaretskii  <eliz@gnu.org>
 
        * dir.c (local_stat) [WINDOWS32]: Use the wrapper on MS-Windows.
diff --git a/job.c b/job.c
index 91da29b17369c943e6e5ca3538eb00a39f5add16..2a470b69d6d04f28fbc0eece555009cd6934c1aa 100644 (file)
--- a/job.c
+++ b/job.c
@@ -3335,7 +3335,7 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
             *t = '\0';
           }
 #ifdef WINDOWS32
-       else    /* non-Posix shell */
+       else    /* non-Posix shell (cmd.exe etc.) */
          {
             const char *f = line;
             char *t = line;
@@ -3404,8 +3404,9 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
            new_argv = xmalloc (2 * sizeof (char *));
            new_argv[0] = xstrdup (*batch_filename);
            new_argv[1] = NULL;
+           return new_argv;
          }
-#else /* WINDOWS32 */
+#endif /* WINDOWS32 */
         /* Create an argv list for the shell command line.  */
         {
           int n = 0;
@@ -3429,7 +3430,6 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
           new_argv[n++] = line;
           new_argv[n++] = NULL;
         }
-#endif /* WINDOWS32 */
         return new_argv;
       }