summaryrefslogtreecommitdiff
path: root/lib/rubygems
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-27 13:33:04 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-27 13:33:04 +0000
commit992cc9469bbe92f97a95a32e09d5916428ebe980 (patch)
tree66a12c3882464057b43ebf3c81d40c56e61960c7 /lib/rubygems
parentf548ed48ebc85cc1b95d4b26ebc7c44c5138c8e9 (diff)
* lib/rubygems/commands/update_command.rb (do_rubygems_update): use
portable and safely ENV operation. reported in <http://slashdot.jp/developers/comments.pl?sid=384937&cid=1273085>. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems')
-rw-r--r--lib/rubygems/commands/update_command.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/rubygems/commands/update_command.rb b/lib/rubygems/commands/update_command.rb
index 7a11ec9554..88d48d705e 100644
--- a/lib/rubygems/commands/update_command.rb
+++ b/lib/rubygems/commands/update_command.rb
@@ -122,11 +122,10 @@ class Gem::Commands::UpdateCommand < Gem::Command
setup_cmd = "#{Gem.ruby} setup.rb #{args.join ' '}"
# Make sure old rubygems isn't loaded
- if Gem.win_platform? then
- system "set RUBYOPT= & #{setup_cmd}"
- else
- system "RUBYOPT=\"\" #{setup_cmd}"
- end
+ old = ENV["RUBYOPT"]
+ ENV.delete("RUBYOPT")
+ system setup_cmd
+ ENV["RUBYOPT"] = old if old
end
end