summaryrefslogtreecommitdiff
path: root/load.c
diff options
context:
space:
mode:
Diffstat (limited to 'load.c')
-rw-r--r--load.c5
1 files changed, 4 insertions, 1 deletions
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