aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ninja.cc2
-rw-r--r--testcase/subshell_in_recipe.mk3
2 files changed, 4 insertions, 1 deletions
diff --git a/ninja.cc b/ninja.cc
index c95ee64..58d65b3 100644
--- a/ninja.cc
+++ b/ninja.cc
@@ -422,7 +422,7 @@ class NinjaGenerator {
bool needs_subshell = (command_count > 1 || c->ignore_error);
if (needs_subshell)
- *cmd_buf += '(';
+ *cmd_buf += "( ";
size_t cmd_start = cmd_buf->size();
StringPiece translated = TranslateCommand(in, cmd_buf);
diff --git a/testcase/subshell_in_recipe.mk b/testcase/subshell_in_recipe.mk
new file mode 100644
index 0000000..7578fe7
--- /dev/null
+++ b/testcase/subshell_in_recipe.mk
@@ -0,0 +1,3 @@
+test:
+ true
+ (echo PASS)