aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/debrew
diff options
context:
space:
mode:
authorJack Nagel2013-02-07 22:31:05 -0600
committerJack Nagel2013-02-07 22:31:05 -0600
commitd547102253d21f11e2ab772c282f96945928c1fa (patch)
treed5de8d7fd2a93921817285522ae235760438e476 /Library/Homebrew/debrew
parentfaa066b109c937aae242c58b6d915925c23dbdf4 (diff)
downloadbrew-d547102253d21f11e2ab772c282f96945928c1fa.tar.bz2
debrew: restore ARGV even when IRB.setup raises
Diffstat (limited to 'Library/Homebrew/debrew')
-rw-r--r--Library/Homebrew/debrew/irb.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/Library/Homebrew/debrew/irb.rb b/Library/Homebrew/debrew/irb.rb
index c81e3cf4b..0e6790af9 100644
--- a/Library/Homebrew/debrew/irb.rb
+++ b/Library/Homebrew/debrew/irb.rb
@@ -6,9 +6,12 @@ module IRB
def IRB.start_within(binding)
unless @setup_done
# make IRB ignore our command line arguments
- saved_args = ARGV.shift(ARGV.size)
- IRB.setup(nil)
- ARGV.concat(saved_args)
+ begin
+ saved_args = ARGV.shift(ARGV.size)
+ IRB.setup(nil)
+ ensure
+ ARGV.replace(saved_args)
+ end
@setup_done = true
end