* process.c, include/ruby/intern.h (rb_run_exec_options): externed.

* process.c (save_redirect_fd, save_env_i, save_env, run_exec_dup2,
	  run_exec_open, run_exec_pgroup, run_exec_rlimit, rb_run_exec_options):
	  save parent's process environments.
	  !!!remark!!! these are not thread-safe.

	* process.c (rb_spawn_internal): remove calling run_exec_options()
	  because cannot restore after spawn. we'll fix this later.

	* io.c (pipe_open): ditto.

	* test/ruby/test_process.rb (test_execopts_env): upcase environment
	  variable name for case insensitive platforms.

	* win32/win32.c (init_env): set USER environment variable only when
	  USERNAME is available.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2008-05-12 14:15:32 +00:00
parent fe7dae730f
commit 9416fedc28
6 changed files with 152 additions and 23 deletions

View file

@ -195,8 +195,8 @@ class TestProcess < Test::Unit::TestCase
}
h = {}
ENV.each {|k,v| h[k] = nil unless k == "PATH" }
IO.popen([h, RUBY, '-e', 'puts ENV.keys']) {|io|
ENV.each {|k,v| h[k] = nil unless k.upcase == "PATH" }
IO.popen([h, RUBY, '-e', 'puts ENV.keys.map{|e|e.upcase}']) {|io|
assert_equal("PATH\n", io.read)
}