1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

load.c: reset errinfo

* load.c (ruby_require_internal): ignore error detail, just return
  an error.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2014-12-03 19:20:36 +00:00
parent 9a12b5ae94
commit 14b56401d1
2 changed files with 9 additions and 1 deletions

View file

@ -1,3 +1,8 @@
Thu Dec 4 04:20:34 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
* load.c (ruby_require_internal): ignore error detail, just return
an error.
Wed Dec 3 17:13:24 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
* encoding.c (load_encoding): use rb_require_internal instead of

5
load.c
View file

@ -1040,7 +1040,10 @@ ruby_require_internal(const char *fname, unsigned int len)
{
struct RString fake;
VALUE str = rb_setup_fake_str(&fake, fname, len, 0);
return rb_require_internal(str, 0);
int result = rb_require_internal(str, 0);
if (result > 1) result = -1;
rb_set_errinfo(Qnil);
return result;
}
VALUE