summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tool/lib/envutil.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/tool/lib/envutil.rb b/tool/lib/envutil.rb
index ab5e8d84e9..fef9a0c992 100644
--- a/tool/lib/envutil.rb
+++ b/tool/lib/envutil.rb
@@ -225,7 +225,8 @@ module EnvUtil
args = [args] if args.kind_of?(String)
# use the same parser as current ruby
- if args.none? { |arg| arg.start_with?("--parser=") }
+ if (args.none? { |arg| arg.start_with?("--parser=") } and
+ /^ +--parser=/ =~ IO.popen([rubybin, "--help"], &:read))
args = ["--parser=#{current_parser}"] + args
end
pid = spawn(child_env, *precommand, rubybin, *args, opt)