mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* dir.c (rb_push_glob): fix overrun. [ruby-dev:24886]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
46a9555860
commit
9c1e33fc45
2 changed files with 13 additions and 4 deletions
|
@ -1,3 +1,7 @@
|
|||
Wed Nov 17 13:05:10 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* dir.c (rb_push_glob): fix overrun. [ruby-dev:24886]
|
||||
|
||||
Wed Nov 17 09:38:18 2004 Johan Holmberg <holmberg@iar.se>
|
||||
|
||||
* re.c (rb_reg_initialize_m): should raise exception instead of
|
||||
|
|
9
dir.c
9
dir.c
|
@ -1500,9 +1500,14 @@ rb_push_glob(str, flags) /* '\0' is delimiter */
|
|||
|
||||
while (offset < RSTRING(str)->len) {
|
||||
int status = push_glob(ary, str, offset, flags);
|
||||
char *p, *pend;
|
||||
if (status) rb_jump_tag(status);
|
||||
offset += strlen(RSTRING(str)->ptr+offset) + 1;
|
||||
while (!RSTRING(str)->ptr[offset]) offset++;
|
||||
p = RSTRING(str)->ptr + offset;
|
||||
p += strlen(p) + 1;
|
||||
pend = RSTRING(str)->ptr + RSTRING(str)->len;
|
||||
while (p < pend && !*p)
|
||||
p++;
|
||||
offset = p - RSTRING(str)->ptr;
|
||||
}
|
||||
|
||||
if (rb_block_given_p()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue