* io.c (read_all): fptr->f may be NULL, if IO is closed in the

signal handler.

* io.c (io_read): ditto.

* string.c (get_pat): remove 1.8.0 warning code.

* string.c (rb_str_match): extend warning until 1.8.2.

* string.c (rb_str_match2): ditto.

* class.c (class_instance_method_list): remove 1.8.0 warnings.
  method_list now recurs.  [ruby-dev:21816]

* class.c (rb_obj_singleton_methods): ditto.

* array.c (rb_ary_select): remove select with block.
  [ruby-dev:21824]

* hash.c (rb_hash_select): ditto.

* hash.c (env_select): ditto.

* re.c (match_select): ditto.

* struct.c (rb_struct_select): ditto.

* process.c (check_uid_switch): remove duplicated error messages.

* process.c (check_gid_switch): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2003-11-04 09:13:57 +00:00
parent 89d1dff343
commit a4934a42cb
13 changed files with 92 additions and 151 deletions

View file

@ -1056,19 +1056,14 @@ rb_str_match(x, y)
long start;
switch (TYPE(y)) {
case T_REGEXP:
return rb_reg_match(y, x);
case T_STRING:
#if RUBY_VERSION_CODE < 181
#if RUBY_VERSION_CODE < 182
rb_warn("string =~ string will be obsolete; use explicit regexp");
#endif
reg = rb_reg_regcomp(y);
start = rb_reg_search(reg, x, 0, 0);
if (start == -1) {
return Qnil;
}
return INT2NUM(start);
y = rb_reg_regcomp(y);
/* fall through */
case T_REGEXP:
return rb_reg_match(y, x);
default:
return rb_funcall(y, rb_intern("=~"), 1, x);
@ -1080,7 +1075,7 @@ rb_str_match2(str)
VALUE str;
{
StringValue(str);
#if RUBY_VERSION_CODE < 181
#if RUBY_VERSION_CODE < 182
rb_warn("~string will be obsolete; use explicit regexp");
#endif
return rb_reg_match2(rb_reg_regcomp(rb_reg_quote(str)));
@ -1501,13 +1496,7 @@ get_pat(pat, quote)
}
if (quote) {
val = rb_reg_quote(pat);
#if RUBY_VERSION_CODE < 181
if (val != pat && rb_str_cmp(val, pat) != 0) {
rb_warn("string pattern instead of regexp; metacharacters no longer effective");
}
#endif
pat = val;
pat = rb_reg_quote(pat);
}
return rb_reg_regcomp(pat);