Use subshell even when a command starts with '('
diff --git a/ninja.cc b/ninja.cc
index 6b1a778..41e5db4 100644
--- a/ninja.cc
+++ b/ninja.cc
@@ -426,9 +426,6 @@
in++;
bool needs_subshell = command_count > 1;
- if (*in == '(') {
- needs_subshell = false;
- }
if (needs_subshell)
*cmd_buf += '(';
diff --git a/runtest.rb b/runtest.rb
index bf42bfe..ab1e26b 100755
--- a/runtest.rb
+++ b/runtest.rb
@@ -108,6 +108,10 @@
# This test expects ninja fails. Strip ninja specific error logs.
log.gsub!(/^FAILED: .*\n/, '')
log.gsub!(/^ninja: .*\n/, '')
+ elsif mk =~ /\/fail_/
+ # Recipes in these tests fail.
+ log.gsub!(/^FAILED: .*/, '*** [test] Error 1')
+ log.gsub!(/^ninja: .*\n/, '')
end
log
end
diff --git a/testcase/fail_subshell_in_recipe.mk b/testcase/fail_subshell_in_recipe.mk
new file mode 100644
index 0000000..c2d2b2d
--- /dev/null
+++ b/testcase/fail_subshell_in_recipe.mk
@@ -0,0 +1,5 @@
+# TODO(go-ninja): Fix
+
+test:
+ false
+ (true) ; echo FAIL