mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* dir.c (push_braces): do not reuse buffer strings. [ruby-core:03806]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
086b1b67eb
commit
6e368fcc3c
2 changed files with 7 additions and 3 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
Thu Nov 25 10:14:26 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* dir.c (push_braces): do not reuse buffer strings. [ruby-core:03806]
|
||||||
|
|
||||||
Wed Nov 24 01:01:31 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Wed Nov 24 01:01:31 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* io.c (io_read): [ruby-dev:24952]
|
* io.c (io_read): [ruby-dev:24952]
|
||||||
|
|
6
dir.c
6
dir.c
|
@ -1189,9 +1189,6 @@ push_braces(ary, str, flags)
|
||||||
|
|
||||||
if (lbrace && rbrace) {
|
if (lbrace && rbrace) {
|
||||||
int len = strlen(s);
|
int len = strlen(s);
|
||||||
buf = rb_str_new(0, len+1);
|
|
||||||
memcpy(RSTRING(buf)->ptr, s, lbrace-s);
|
|
||||||
b = RSTRING(buf)->ptr + (lbrace-s);
|
|
||||||
p = lbrace;
|
p = lbrace;
|
||||||
while (*p != '}') {
|
while (*p != '}') {
|
||||||
t = p + 1;
|
t = p + 1;
|
||||||
|
@ -1199,6 +1196,9 @@ push_braces(ary, str, flags)
|
||||||
/* skip inner braces */
|
/* skip inner braces */
|
||||||
if (*p == '{') while (*p!='}') p++;
|
if (*p == '{') while (*p!='}') p++;
|
||||||
}
|
}
|
||||||
|
buf = rb_str_new(0, len+1);
|
||||||
|
memcpy(RSTRING(buf)->ptr, s, lbrace-s);
|
||||||
|
b = RSTRING(buf)->ptr + (lbrace-s);
|
||||||
memcpy(b, t, p-t);
|
memcpy(b, t, p-t);
|
||||||
strcpy(b+(p-t), rbrace+1);
|
strcpy(b+(p-t), rbrace+1);
|
||||||
status = push_braces(ary, buf, flags);
|
status = push_braces(ary, buf, flags);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue