From 4b7fd61a05aff71d5044f985ac3c7924bed9e403 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 6 Nov 2016 00:58:49 +0000 Subject: process.c: PATH env in spawn * process.c (rb_exec_fillarg): honor the given path environment variable. [ruby-core:53103] [Bug #8004] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56618 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_process.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/ruby/test_process.rb') diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index 812af7a615..3921395466 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -316,6 +316,16 @@ class TestProcess < Test::Unit::TestCase end end + def test_execopt_env_path + bug8004 = '[ruby-core:53103] [Bug #8004]' + Dir.mktmpdir do |d| + open("#{d}/tmp_script.cmd", "w") {|f| f.puts ": ;"; f.chmod(0755)} + assert_not_nil(pid = Process.spawn({"PATH" => d}, "tmp_script.cmd"), bug8004) + wpid, st = Process.waitpid2(pid) + assert_equal([pid, true], [wpid, st.success?], bug8004) + end + end + def _test_execopts_env_popen(cmd) message = cmd.inspect IO.popen({"FOO"=>"BAR"}, cmd) {|io| -- cgit v1.2.3