summaryrefslogtreecommitdiff
path: root/tool/compile_prelude.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-11-15 08:30:07 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-11-15 08:30:07 +0000
commit479c06d19d415f19a97f296c27a8a021f0c131c6 (patch)
tree7856ec5e2b509a75f2a36ead4e0c7bf0b3c0e882 /tool/compile_prelude.rb
parentf1bc46f06d56232b38d53e263efc631efe68eb9b (diff)
* tool/compile_prelude.rb: absolute path may not start with a slash.
pointed by usa. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13932 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/compile_prelude.rb')
-rw-r--r--tool/compile_prelude.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/tool/compile_prelude.rb b/tool/compile_prelude.rb
index 4d08b4d..314c986 100644
--- a/tool/compile_prelude.rb
+++ b/tool/compile_prelude.rb
@@ -33,8 +33,8 @@ lines_list = preludes.map {|filename|
unless mkconf
require 'rbconfig'
mkconf = RbConfig::MAKEFILE_CONFIG.merge('prefix'=>'#{TMP_RUBY_PREFIX}')
- exlen = $:.grep(%r{\A/}).last.length - RbConfig::CONFIG["prefix"].length
- setup_ruby_prefix = "TMP_RUBY_PREFIX = $:.grep(%r{\\A/}).last[0..#{-exlen-1}]\n"
+ exlen = $:.reverse.find{|e|e!="."}.length - RbConfig::CONFIG["prefix"].length
+ setup_ruby_prefix = "TMP_RUBY_PREFIX = $:.reverse.find{|e|e!=\".\"}[0..#{-exlen-1}]\n"
teardown_ruby_prefix = 'Object.class_eval { remove_const "TMP_RUBY_PREFIX" }'
end
if RbConfig::MAKEFILE_CONFIG.has_key? key