Skip to content

Commit

Permalink
jruby: fix stack overflow in jgem command.
Browse files Browse the repository at this point in the history
In jruby 1.7.10 (possibly earlier) the script in bin/gem simply calls bin/jgem. The jruby formula overwrites jgem with gem in the 'prefix with j' paragraph. This way the jgem script end up calling itself infinitely causing a stack overflow crash.

Closes Homebrew/legacy-homebrew#26910.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
  • Loading branch information
pepijnve authored and MikeMcQuaid committed Feb 23, 2014
1 parent a936276 commit bd35d15
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Formula/jruby.rb
Expand Up @@ -9,11 +9,13 @@ def install
# Remove Windows files
rm Dir['bin/*.{bat,dll,exe}']

# Prefix a 'j' on some commands
cd 'bin' do
Dir['*'].each do |file|
mv file, "j#{file}" unless file.match /^[j]/
end
# Prefix a 'j' on some commands to avoid clashing with other ruby installations
['ast', 'rake', 'rdoc', 'ri', 'testrb'].each { |f| mv f, "j#{f}" }
# Delete some unnecessary command
# gem is a wrapper script for jgem
# irb is an identical copy of jirb
['gem', 'irb'].each { |f| rm f }
end

# Only keep the OS X native libraries
Expand Down

0 comments on commit bd35d15

Please sign in to comment.