summaryrefslogtreecommitdiff
path: root/variable.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-09-28 15:58:32 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-09-28 15:58:32 +0000
commit79958f7c74f5ad554f5c39aeee633586ba9d2bfc (patch)
treec4894c535090f0b7f9575a99ff1fc5709ad30f0b /variable.c
parente594bf57d86fa288404a842d9b7b86b28e89d9ad (diff)
* eval.c (ev_const_get), variable.c (rb_const_get_0): retry only when
autoload succeeded. * variable.c (rb_autoload_load): now return true if autoload succeeded. fixed: [ruby-dev:27331] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9333 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'variable.c')
-rw-r--r--variable.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/variable.c b/variable.c
index 34a978f253..610dae2261 100644
--- a/variable.c
+++ b/variable.c
@@ -1329,7 +1329,7 @@ autoload_delete(mod, id)
return (NODE *)load;
}
-void
+VALUE
rb_autoload_load(klass, id)
VALUE klass;
ID id;
@@ -1338,9 +1338,9 @@ rb_autoload_load(klass, id)
NODE *load = autoload_delete(klass, id);
if (!load || !(file = load->nd_lit) || rb_provided(RSTRING(file)->ptr)) {
- const_missing(klass, id);
+ return Qfalse;
}
- rb_require_safe(file, load->nd_nth);
+ return rb_require_safe(file, load->nd_nth);
}
static VALUE
@@ -1406,7 +1406,7 @@ rb_const_get_0(klass, id, exclude, recurse)
while (tmp) {
while (RCLASS(tmp)->iv_tbl && st_lookup(RCLASS(tmp)->iv_tbl,id,&value)) {
if (value == Qundef) {
- rb_autoload_load(tmp, id);
+ if (!RTEST(rb_autoload_load(tmp, id))) break;
continue;
}
if (exclude && tmp == rb_cObject && klass != rb_cObject) {