diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-05-01 09:38:01 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-05-01 09:38:01 +0000 |
commit | 8145a071a9acc46541a8967d031a872d15065842 (patch) | |
tree | 082ba11a11351baf7b1afad6e267ff9ca1968c1b /variable.c | |
parent | 11a1286fe10c6e6fd3b56708958f04b5d0189f2b (diff) |
* file.c (rb_find_file): load must be done from an abolute path if
$SAFE >= 4.
* re.c (rb_reg_s_quote): quote whitespaces for /x cases.
* eval.c (rb_thread_cleanup): should not terminate main_thread by
Fatal error.
* regex.c (is_in_list): need to not exclude NUL and NEWLINE.
* re.c (rb_reg_expr_str): wrong backslash escapement.
* re.c (rb_reg_expr_str): do not escape embedded space
characters.
* eval.c (rb_thread_cleanup): current thread may be THREAD_STOPPED,
for example when terminated from signal handler.
* re.c (rb_reg_expr_str): should treat backslash specially in
escaping.
* bignum.c (rb_big_eq): check `y == x' if y is neither Fixnum,
Bignum, nor Float.
* pack.c (pack_unpack): should treat 'U' in character unit, not in
byte unit.
* marshal.c (w_uclass): should check based on rb_obj_class(), not
CLASS_OF().
* io.c (io_write): check error if written data is less than
specified size to detect EPIPE.
* 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.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@2419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'variable.c')
-rw-r--r-- | variable.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/variable.c b/variable.c index 087f5e6cdd..9e9222d7c5 100644 --- a/variable.c +++ b/variable.c @@ -342,9 +342,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; } @@ -911,9 +910,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; } @@ -1376,7 +1374,7 @@ 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); |