summaryrefslogtreecommitdiff
path: root/re.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-05-06 06:51:31 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-05-06 06:51:31 +0000
commit7752fb4205ecf5de2021a7924c213516c8a8d858 (patch)
tree112f7e4154e500bf48240f8b4cfaab09e351fd6e /re.c
parent6154ce97a7915ac70326c007ee04a22fe5742e04 (diff)
* object.c (rb_obj_methods): list singleton methods if recur
argument is false; list all methods otherwise. * numeric.c (num_step): double epsilon to make "1.1.step(1.5,0.1)" to work. * ext/gdbm/gdbm.c (fgdbm_values_at): new method to replace select(index..). * ext/sdbm/init.c (fsdbm_values_at): ditto. * ext/dbm/dbm.c (fdbm_values_at): ditto. * ext/dbm/dbm.c (DBM::VERSION): defined. * ext/gdbm/testgdbm.rb: replace select with values_at. * ext/sdbm/testsdbm.rb: ditto. * ext/dbm/testdbm.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 're.c')
-rw-r--r--re.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/re.c b/re.c
index 2bb0411..6d08fb8 100644
--- a/re.c
+++ b/re.c
@@ -990,6 +990,9 @@ match_select(argc, argv, match)
rb_warn("MatchData#select(index..) is deprecated; use MatchData#values_at");
return match_values_at(argc, argv, match);
}
+ if (argc > 0) {
+ rb_raise(rb_eArgError, "wrong number arguments(%d for 0)", argc);
+ }
else {
struct re_registers *regs = RMATCH(match)->regs;
VALUE target = RMATCH(match)->str;
@@ -1000,7 +1003,7 @@ match_select(argc, argv, match)
for (i=0; i<regs->num_regs; i++) {
VALUE str = rb_str_substr(target, regs->beg[i], regs->end[i]-regs->beg[i]);
if (taint) OBJ_TAINT(str);
- if (rb_yield(str)) {
+ if (RTEST(rb_yield(str))) {
rb_ary_push(result, str);
}
}