From e3cf77804a25135fbe2476c34e8bab861cfb534d Mon Sep 17 00:00:00 2001 From: usa Date: Thu, 27 Dec 2007 13:33:04 +0000 Subject: * lib/rubygems/commands/update_command.rb (do_rubygems_update): use portable and safely ENV operation. reported in . git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rubygems/commands/update_command.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/rubygems/commands/update_command.rb b/lib/rubygems/commands/update_command.rb index 7a11ec955..88d48d705 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 -- cgit