diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-07-18 14:47:11 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-07-18 14:47:11 +0000 |
commit | f10eb2c3630b7518d49b35d762c40a61fa363715 (patch) | |
tree | ecf33c147e6624d55b9d4ce8f58ef4b18963de4f /load.c | |
parent | 22f75c300d1fc5341fb21126adc787f30c310bdf (diff) | |
download | ruby-f10eb2c3630b7518d49b35d762c40a61fa363715.tar.gz |
load.c: use TAG_RETURN
* load.c (rb_require_internal): use TAG_RETURN not a magic number.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51294 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'load.c')
-rw-r--r-- | load.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -1007,7 +1007,7 @@ rb_require_internal(VALUE fname, int safe) } else if (!*ftptr) { rb_provide_feature(path); - result = 1; + result = TAG_RETURN; } else { switch (found) { @@ -1022,7 +1022,7 @@ rb_require_internal(VALUE fname, int safe) break; } rb_provide_feature(path); - result = 1; + result = TAG_RETURN; } } } @@ -1052,9 +1052,8 @@ ruby_require_internal(const char *fname, unsigned int len) struct RString fake; VALUE str = rb_setup_fake_str(&fake, fname, len, 0); int result = rb_require_internal(str, 0); - if (result > 1) result = -1; rb_set_errinfo(Qnil); - return result; + return result == TAG_RETURN ? 1 : result ? -1 : 0; } VALUE @@ -1062,7 +1061,7 @@ rb_require_safe(VALUE fname, int safe) { int result = rb_require_internal(fname, safe); - if (result > 1) { + if (result > TAG_RETURN) { JUMP_TAG(result); } if (result < 0) { |