diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-04-11 10:03:01 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-04-11 10:03:01 +0000 |
commit | 5527b3b961a76f2de03a5e42b80a99d8f9b44bdf (patch) | |
tree | 5ff49695caf66116c44adbd1a331e53eeab4dd43 /variable.c | |
parent | 3a202ff2b4b39e910c7b99e2993ac5e5e12f2ad1 (diff) |
* eval.c (assign): ruby_verbose should be surrounded by RTEST().
* object.c (rb_str2cstr): ditto.
* parse.y (void_expr): ditto.
* parse.y (void_stmts): ditto.
* variable.c (rb_ivar_get): ditto.
* variable.c (rb_cvar_set): ditto.
* variable.c (rb_cvar_get): ditto.
* dir.c (glob_helper): should have proceed link when link->path
was non existing symbolic link.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'variable.c')
-rw-r--r-- | variable.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/variable.c b/variable.c index 9a25caa2a7..339df10db1 100644 --- a/variable.c +++ b/variable.c @@ -353,9 +353,8 @@ static VALUE undef_getter(id) ID id; { - if (ruby_verbose) { - rb_warning("global variable `%s' not initialized", rb_id2name(id)); - } + rb_warning("global variable `%s' not initialized", rb_id2name(id)); + return Qnil; } @@ -945,9 +944,8 @@ rb_ivar_get(obj, id) return generic_ivar_get(obj, id); break; } - if (ruby_verbose) { - rb_warning("instance variable %s not initialized", rb_id2name(id)); - } + rb_warning("instance variable %s not initialized", rb_id2name(id)); + return Qnil; } @@ -1461,11 +1459,11 @@ rb_cvar_set(klass, id, val, warn) if (OBJ_FROZEN(tmp)) rb_error_frozen("class/module"); if (!OBJ_TAINTED(tmp) && rb_safe_level() >= 4) rb_raise(rb_eSecurityError, "Insecure: can't modify class variable"); - if (warn && ruby_verbose && klass != tmp) { + if (warn && RTEST(ruby_verbose) && klass != tmp) { rb_warning("already initialized class variable %s", rb_id2name(id)); } st_insert(RCLASS(tmp)->iv_tbl,id,val); - if (ruby_verbose) { + if (RTEST(ruby_verbose)) { cvar_override_check(id, tmp); } return; @@ -1488,7 +1486,7 @@ rb_cvar_get(klass, id) while (tmp) { if (RCLASS(tmp)->iv_tbl) { if (st_lookup(RCLASS(tmp)->iv_tbl,id,&value)) { - if (ruby_verbose) { + if (RTEST(ruby_verbose)) { cvar_override_check(id, tmp); } return value; |