summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-10-23 09:36:38 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-10-23 09:36:38 +0000
commit738e62a3f11871ec361b32ca7efdec0d3ab0c968 (patch)
tree5ab42990d0d8b5fd29c3f3091af1a03212c4e39a
parentcfa233b52e85c78192900b69a965adb406dda1b7 (diff)
merges r29133 from trunk into ruby_1_9_2.
-- * load.c (load_failed): should honor encoding. [ruby-core:31915] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@29562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--load.c5
-rw-r--r--test/ruby/test_require.rb6
-rw-r--r--version.h2
4 files changed, 14 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index f16a13d610..e60618ba89 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Sun Aug 29 12:19:58 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * load.c (load_failed): should honor encoding. [ruby-core:31915]
+
Fri Aug 27 12:26:23 2010 NAKAMURA Usaku <usa@ruby-lang.org>
* object.c (rb_obj_class): remove mention of obsolete method.
diff --git a/load.c b/load.c
index fc2c9bf52e..f8f0551a5a 100644
--- a/load.c
+++ b/load.c
@@ -550,8 +550,9 @@ search_required(VALUE fname, volatile VALUE *path, int safe_level)
static void
load_failed(VALUE fname)
{
- rb_raise(rb_eLoadError, "no such file to load -- %s",
- RSTRING_PTR(fname));
+ VALUE mesg = rb_str_buf_new_cstr("no such file to load -- ");
+ rb_str_append(mesg, fname); /* should be ASCII compatible */
+ rb_exc_raise(rb_exc_new3(rb_eLoadError, mesg));
}
static VALUE
diff --git a/test/ruby/test_require.rb b/test/ruby/test_require.rb
index 40eb67da26..cceae19520 100644
--- a/test/ruby/test_require.rb
+++ b/test/ruby/test_require.rb
@@ -40,6 +40,12 @@ class TestRequire < Test::Unit::TestCase
end
end
+ def test_require_nonascii
+ bug3758 = '[ruby-core:31915]'
+ e = assert_raise(LoadError, bug3758) {require "\u{221e}"}
+ assert_match(/\u{221e}\z/, e.message, bug3758)
+ end
+
def test_require_path_home
env_rubypath, env_home = ENV["RUBYPATH"], ENV["HOME"]
diff --git a/version.h b/version.h
index 66a8f4d5a0..182d2f3539 100644
--- a/version.h
+++ b/version.h
@@ -1,5 +1,5 @@
#define RUBY_VERSION "1.9.2"
-#define RUBY_PATCHLEVEL 15
+#define RUBY_PATCHLEVEL 16
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 9
#define RUBY_VERSION_TEENY 1