diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-31 06:09:13 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-31 06:09:13 +0000 |
commit | bc70ea70cd455261d185ec386e4c04ce9ccabf62 (patch) | |
tree | 2abf5e35fed67c4cba083cb0ae0dc63a39ae56ac /tool | |
parent | a436212282330a6b132e0a4174178a4ca253dea0 (diff) |
* tool/compile_prelude.rb: too long string literal causes compile error
on some platforms.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool')
-rwxr-xr-x | tool/compile_prelude.rb | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/tool/compile_prelude.rb b/tool/compile_prelude.rb index 48b9e2e1cf..88b7d69f11 100755 --- a/tool/compile_prelude.rb +++ b/tool/compile_prelude.rb @@ -51,17 +51,22 @@ lines_list = preludes.map {|filename| "nil" end } - line.gsub!(/require\s*(\(?)\s*(["'])(.*?)\2\s*\1/) { + if /require\s*(\(?)\s*(["'])(.*?)\2\s*\1/ =~ line orig, path = $&, $3 srcdir = File.expand_path("../..", __FILE__) path = File.expand_path(path, srcdir) if File.exist?(path) - "eval(%s, TOPLEVEL_BINDING, %s, %d)" % [ File.read(path).dump, prelude_name(filename, path).dump, 1] + lines << c_esc("eval(") + File.readlines(path).each do |line| + lines << c_esc(line.dump) + end + lines << c_esc(", TOPLEVEL_BINDING, %s, %d)" % [ prelude_name(filename, path).dump, 1]) else - orig + lines << c_esc(orig) end - } - lines << c_esc(line) + else + lines << c_esc(line) + end } setup_lines = [] if need_ruby_prefix |