mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 21:14:23 +02:00
* 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
This commit is contained in:
parent
feb1dfdfc6
commit
f5f1a18ceb
5 changed files with 38 additions and 4 deletions
3
string.c
3
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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue