1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* re.c (rb_reg_nth_match): tail sharing.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2002-12-17 12:15:45 +00:00
parent dd8a919a00
commit 49fc21f31e
2 changed files with 5 additions and 3 deletions

View file

@ -1,4 +1,4 @@
Tue Dec 17 19:29:45 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net> Tue Dec 17 21:08:29 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
* node.h (NODE_ATTRASGN): new node, assignment to attribute. * node.h (NODE_ATTRASGN): new node, assignment to attribute.
[ruby-core:00637]. [ruby-core:00637].
@ -9,6 +9,8 @@ Tue Dec 17 19:29:45 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
* string.c (rb_str_substr): tail sharing. [ruby-core:00650] * string.c (rb_str_substr): tail sharing. [ruby-core:00650]
* re.c (rb_reg_nth_match): ditto.
Tue Dec 17 04:03:45 2002 Tanaka Akira <akr@m17n.org> Tue Dec 17 04:03:45 2002 Tanaka Akira <akr@m17n.org>
* lib/open-uri.rb: new file. * lib/open-uri.rb: new file.

4
re.c
View file

@ -778,8 +778,8 @@ rb_reg_nth_match(nth, match)
if (start == -1) return Qnil; if (start == -1) return Qnil;
end = RMATCH(match)->END(nth); end = RMATCH(match)->END(nth);
len = end - start; len = end - start;
str = rb_str_new(RSTRING(RMATCH(match)->str)->ptr + start, len); str = rb_str_substr(RMATCH(match)->str, start, len);
if (OBJ_TAINTED(match)) OBJ_TAINT(str); OBJ_INFECT(str, match);
return str; return str;
} }