summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rwxr-xr-xtool/compile_prelude.rb15
2 files changed, 15 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 3a1bf6c469..503a24fc17 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Jul 31 15:06:33 2009 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * tool/compile_prelude.rb: too long string literal causes compile error
+ on some platforms.
+
Fri Jul 31 13:15:27 2009 NAKAMURA Usaku <usa@ruby-lang.org>
* transcode.c (str_encode_bang): C99ism.
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