1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* re.c (rb_reg_match): should clear $~ if operand is nil.

* re.c (rb_reg_match2): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@2199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2002-03-14 06:21:38 +00:00
parent fbcbf1b8fd
commit 7bb210b303
3 changed files with 15 additions and 4 deletions

View file

@ -1,3 +1,9 @@
Thu Mar 14 00:29:12 2002 Yukihiro Matsumoto <matz@ruby-lang.org>
* re.c (rb_reg_match): should clear $~ if operand is nil.
* re.c (rb_reg_match2): ditto.
Wed Mar 13 18:50:29 2002 Akinori MUSHA <knu@iDaemons.org>
* lib/getopts.rb: Merge from 1.7. Rewrite to fix some bugs and

9
re.c
View file

@ -943,7 +943,10 @@ rb_reg_match(re, str)
{
int start;
if (NIL_P(str)) return Qnil;
if (NIL_P(str)) {
rb_backref_set(Qnil);
return Qnil;
}
str = rb_str_to_str(str);
start = rb_reg_search(re, str, 0, 0);
if (start < 0) {
@ -959,8 +962,10 @@ rb_reg_match2(re)
int start;
VALUE line = rb_lastline_get();
if (TYPE(line) != T_STRING)
if (TYPE(line) != T_STRING) {
rb_backref_set(Qnil);
return Qnil;
}
start = rb_reg_search(re, line, 0, 0);
if (start < 0) {

View file

@ -1,4 +1,4 @@
#define RUBY_VERSION "1.6.7"
#define RUBY_RELEASE_DATE "2002-03-13"
#define RUBY_RELEASE_DATE "2002-03-14"
#define RUBY_VERSION_CODE 167
#define RUBY_RELEASE_CODE 20020313
#define RUBY_RELEASE_CODE 20020314