summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-04-14 09:19:52 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-04-14 09:19:52 +0000
commitf5f1a18ceb87cd8ffa065a57b95f6d716ed6902c (patch)
treef5b9f01d28de0c0b38e285a9ad85ad0e9a6eb067 /string.c
parentfeb1dfdfc6dedfb929e08c4f3aaf21f4983c8b25 (diff)
* enum.c (enum_find, enum_reject): Return an enumerator if no
block is given. * io.c (rb_io_each_line, rb_io_each_byte, rb_io_s_foreach, argf_each_line, argf_each_byte): Ditto. * string.c (str_gsub): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/string.c b/string.c
index bb3ba22ba7..403d595527 100644
--- a/string.c
+++ b/string.c
@@ -2096,7 +2096,8 @@ str_gsub(argc, argv, str, bang)
char *buf, *bp, *sp, *cp;
int tainted = 0;
- if (argc == 1 && rb_block_given_p()) {
+ if (argc == 1) {
+ RETURN_ENUMERATOR(str, argc, argv);
iter = 1;
}
else if (argc == 2) {