diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1998-11-09 09:11:52 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1998-11-09 09:11:52 +0000 |
commit | ee5ab9cc136baf18756abc6bd5d136a0231f973e (patch) | |
tree | abdc351cbffd7b67f63f41ea08f544819af0a28b /re.c | |
parent | dc8da69e7cbc54f020ef1182fd28e57bbaa40fc3 (diff) |
1.1c7
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@316 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 're.c')
-rw-r--r-- | re.c | 18 |
1 files changed, 6 insertions, 12 deletions
@@ -718,13 +718,11 @@ reg_match(re, str) { int start; - if (NIL_P(str)) return FALSE; + if (NIL_P(str)) return Qnil; str = str_to_str(str); start = reg_search(re, str, 0, 0); - if (start < 0) { - return FALSE; - } - return INT2FIX(start); + if (start >= 0) return INT2FIX(start); + return Qnil; } VALUE @@ -734,14 +732,10 @@ reg_match2(re) int start; VALUE line = lastline_get(); - if (TYPE(line) != T_STRING) - return FALSE; - + if (TYPE(line) != T_STRING) return Qnil; start = reg_search(re, line, 0, 0); - if (start < 0) { - return FALSE; - } - return INT2FIX(start); + if (start >= 0) return INT2FIX(start); + return Qnil; } static VALUE |