From 74d9163b8475c70526c8fe0b3dd09020fc2f36e3 Mon Sep 17 00:00:00 2001 From: Vladimir Sizikov Date: Sun, 4 Oct 2009 12:07:34 +0200 Subject: [PATCH] JRUBY-4042: [windows] jruby.bat without parameters fails Also, added a unit test for this. --- bin/_jrubyvmopts.bat | 6 ++++++ test/test_launching_by_shell_script.rb | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/bin/_jrubyvmopts.bat b/bin/_jrubyvmopts.bat index 2948c1540dd..e5a81c032cf 100644 --- a/bin/_jrubyvmopts.bat +++ b/bin/_jrubyvmopts.bat @@ -166,7 +166,13 @@ set _CMP= goto vmoptsLoop :vmoptsDone + +rem substitute _P only if _RUBY_OPTS is defined, +rem otherwise we'll get an error. +if not defined _RUBY_OPTS goto rubyoptsDone set _RUBY_OPTS=%_RUBY_OPTS:_P=|% + +:rubyoptsDone set _VM_OPTS=%_VM_OPTS% %_JAVA_VM% %_MEM% %_STK% %_DFLT_VM_OPTS% set _DFLT_VM_OPTS= set _MEM= diff --git a/test/test_launching_by_shell_script.rb b/test/test_launching_by_shell_script.rb index 8cd457aefc4..b0c19cb6397 100644 --- a/test/test_launching_by_shell_script.rb +++ b/test/test_launching_by_shell_script.rb @@ -14,6 +14,12 @@ def test_launch_script assert_equal 0, $?.exitstatus end + # JRUBY-4042 + def test_jruby_without_args + jruby_with_pipe("echo puts 1") + assert_equal 0, $?.exitstatus + end + if WINDOWS def test_system_call_without_stdin_data_doesnt_hang out = jruby(%q{-e "system 'dir test'"})