diff options
| -rw-r--r-- | miscutils/make.c | 3 | ||||
| -rwxr-xr-x | testsuite/make.tests | 7 |
2 files changed, 8 insertions, 2 deletions
diff --git a/miscutils/make.c b/miscutils/make.c index 87f17aad7..970919ddc 100644 --- a/miscutils/make.c +++ b/miscutils/make.c | |||
| @@ -2217,7 +2217,7 @@ docmds(struct name *np, struct cmd *cp) | |||
| 2217 | if (sdomake) { | 2217 | if (sdomake) { |
| 2218 | // Get the shell to execute it | 2218 | // Get the shell to execute it |
| 2219 | int status; | 2219 | int status; |
| 2220 | char *cmd = !signore ? auto_concat("set -e;", q) : q; | 2220 | char *cmd = !signore && posix ? auto_concat("set -e;", q) : q; |
| 2221 | 2221 | ||
| 2222 | target = np; | 2222 | target = np; |
| 2223 | status = system(cmd); | 2223 | status = system(cmd); |
| @@ -2233,7 +2233,6 @@ docmds(struct name *np, struct cmd *cp) | |||
| 2233 | diagnostic("failed to build '%s'", np->n_name); | 2233 | diagnostic("failed to build '%s'", np->n_name); |
| 2234 | estat |= MAKE_FAILURE; | 2234 | estat |= MAKE_FAILURE; |
| 2235 | free(command); | 2235 | free(command); |
| 2236 | free(cmd); | ||
| 2237 | break; | 2236 | break; |
| 2238 | } else if (doinclude) { | 2237 | } else if (doinclude) { |
| 2239 | warning("failed to build '%s'", np->n_name); | 2238 | warning("failed to build '%s'", np->n_name); |
diff --git a/testsuite/make.tests b/testsuite/make.tests index 1fc95a8d2..c512fbdaa 100755 --- a/testsuite/make.tests +++ b/testsuite/make.tests | |||
| @@ -497,6 +497,13 @@ test.b: | |||
| 497 | ' | 497 | ' |
| 498 | cd .. || exit 1; rm -rf make.tempdir 2>/dev/null | 498 | cd .. || exit 1; rm -rf make.tempdir 2>/dev/null |
| 499 | 499 | ||
| 500 | # Don't use the shell -e option when running commands. | ||
| 501 | testing "make no shell -e option when running commands" \ | ||
| 502 | "make -f -" "OK\n" "" ' | ||
| 503 | target: | ||
| 504 | @false; echo OK | ||
| 505 | ' | ||
| 506 | |||
| 500 | # An empty original suffix indicates that every word should have | 507 | # An empty original suffix indicates that every word should have |
| 501 | # the new suffix added. If neither suffix is provided the words | 508 | # the new suffix added. If neither suffix is provided the words |
| 502 | # remain unchanged. | 509 | # remain unchanged. |
