mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* load.c (load_failed): should honor encoding. [ruby-core:31915]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
909d638aec
commit
946a037e30
3 changed files with 13 additions and 2 deletions
|
@ -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]
|
||||
|
||||
Sun Aug 29 09:35:10 2010 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* common.mk (clean): exclude *.inc. [ruby-dev:41931]
|
||||
|
|
5
load.c
5
load.c
|
@ -551,8 +551,9 @@ search_required(VALUE fname, volatile VALUE *path, int safe_level)
|
|||
static void
|
||||
load_failed(VALUE fname)
|
||||
{
|
||||
rb_raise(rb_eLoadError, "cannot load such file -- %s",
|
||||
RSTRING_PTR(fname));
|
||||
VALUE mesg = rb_str_buf_new_cstr("cannot load such file -- ");
|
||||
rb_str_append(mesg, fname); /* should be ASCII compatible */
|
||||
rb_exc_raise(rb_exc_new3(rb_eLoadError, mesg));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
|
|
|
@ -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"]
|
||||
|
||||
|
|
Loading…
Reference in a new issue