summaryrefslogtreecommitdiffstats
path: root/variable.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-04-07 18:39:28 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-04-07 18:39:28 +0000
commit460c46a3a78d9956c04543333f6c8f01fa1b0a87 (patch)
treeb96ae47f8fe939bb59cf6b3d9f89132ac9261934 /variable.c
parentfb7b937f099bc47c457b5cc636ef709773c59694 (diff)
downloadruby-460c46a3a78d9956c04543333f6c8f01fa1b0a87.tar.gz
ruby-460c46a3a78d9956c04543333f6c8f01fa1b0a87.tar.xz
ruby-460c46a3a78d9956c04543333f6c8f01fa1b0a87.zip
* load.c (rb_provided): check expanded path for relative path
features, loading or loaded features are already expanded in 1.9. * variable.c (rb_autoload_load): no needs to check if provided before rb_require_safe. [ruby-dev:34266] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'variable.c')
-rw-r--r--variable.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/variable.c b/variable.c
index 8f745e5a3..154f0872b 100644
--- a/variable.c
+++ b/variable.c
@@ -1374,7 +1374,7 @@ rb_autoload_load(VALUE klass, ID id)
VALUE file;
NODE *load = autoload_delete(klass, id);
- if (!load || !(file = load->nd_lit) || rb_provided(RSTRING_PTR(file))) {
+ if (!load || !(file = load->nd_lit)) {
return Qfalse;
}
return rb_require_safe(file, load->nd_nth);
@@ -1393,7 +1393,7 @@ autoload_file(VALUE mod, ID id)
}
file = ((NODE *)load)->nd_lit;
Check_Type(file, T_STRING);
- if (!RSTRING_PTR(file)) {
+ if (!RSTRING_PTR(file) || !*RSTRING_PTR(file)) {
rb_raise(rb_eArgError, "empty file name");
}
if (!rb_provided(RSTRING_PTR(file))) {
@@ -1433,7 +1433,7 @@ rb_const_get_0(VALUE klass, ID id, int exclude, int recurse)
tmp = klass;
retry:
- while (tmp && !NIL_P(tmp)) {
+ while (RTEST(tmp)) {
while (RCLASS_IV_TBL(tmp) && st_lookup(RCLASS_IV_TBL(tmp),id,&value)) {
if (value == Qundef) {
if (!RTEST(rb_autoload_load(tmp, id))) break;