From 14b56401d1557e1f166c91070ba9a85025dca71c Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 3 Dec 2014 19:20:36 +0000 Subject: [PATCH] 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 --- ChangeLog | 5 +++++ load.c | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 24008a949b..fe96d429fb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Dec 4 04:20:34 2014 Nobuyoshi Nakada + + * load.c (ruby_require_internal): ignore error detail, just return + an error. + Wed Dec 3 17:13:24 2014 Nobuyoshi Nakada * encoding.c (load_encoding): use rb_require_internal instead of diff --git a/load.c b/load.c index 4f1a0c1a78..65017c9895 100644 --- a/load.c +++ b/load.c @@ -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