summaryrefslogtreecommitdiff
path: root/job.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2013-04-27 17:28:05 -0400
committerPaul Smith <psmith@gnu.org>2013-04-27 17:28:05 -0400
commit5a7c4187fbe93cd026d9427647cfb11b5391ae18 (patch)
tree8cb0f60c03eb50c017b91fe83e77046dc19dd7c9 /job.c
parent7353dc2e07da31fd755acd4fa5bcb689cb64999b (diff)
downloadmake-5a7c4187fbe93cd026d9427647cfb11b5391ae18.tar.gz
Fix support for .ONESHELL when dealing with non-POSIX shells.
Diffstat (limited to 'job.c')
-rw-r--r--job.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/job.c b/job.c
index 61568f94..addeca2d 100644
--- a/job.c
+++ b/job.c
@@ -3272,30 +3272,6 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
}
}
*t = '\0';
-
- /* Create an argv list for the shell command line. */
- {
- int n = 0;
-
- new_argv = xmalloc ((4 + sflags_len/2) * sizeof (char *));
- new_argv[n++] = xstrdup (shell);
-
- /* Chop up the shellflags (if any) and assign them. */
- if (! shellflags)
- new_argv[n++] = xstrdup ("");
- else
- {
- const char *s = shellflags;
- char *t;
- unsigned int len;
- while ((t = find_next_token (&s, &len)) != 0)
- new_argv[n++] = xstrndup (t, len);
- }
-
- /* Set the command to invoke. */
- new_argv[n++] = line;
- new_argv[n++] = NULL;
- }
}
#ifdef WINDOWS32
else /* non-Posix shell */
@@ -3368,8 +3344,32 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
new_argv[0] = xstrdup (*batch_filename);
new_argv[1] = NULL;
}
-#endif /* WINDOWS32 */
- return new_argv;
+#else /* WINDOWS32 */
+ /* Create an argv list for the shell command line. */
+ {
+ int n = 0;
+
+ new_argv = xmalloc ((4 + sflags_len/2) * sizeof (char *));
+ new_argv[n++] = xstrdup (shell);
+
+ /* Chop up the shellflags (if any) and assign them. */
+ if (! shellflags)
+ new_argv[n++] = xstrdup ("");
+ else
+ {
+ const char *s = shellflags;
+ char *t;
+ unsigned int len;
+ while ((t = find_next_token (&s, &len)) != 0)
+ new_argv[n++] = xstrndup (t, len);
+ }
+
+ /* Set the command to invoke. */
+ new_argv[n++] = line;
+ new_argv[n++] = NULL;
+ }
+#endif /* WINDOWS32 */
+ return new_argv;
}
new_line = xmalloc ((shell_len*2) + 1 + sflags_len + 1