mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* string.c (rb_str_scan): add string modification check.
[ruby-core:7216] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b8034ca54f
commit
69be57eb57
2 changed files with 7 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
Wed Jul 26 16:39:07 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* string.c (rb_str_scan): add string modification check.
|
||||
[ruby-core:7216]
|
||||
|
||||
Wed Jul 26 16:06:03 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* lib/cgi.rb (CGI::QueryExtension::read_multipart): check
|
||||
|
|
2
string.c
2
string.c
|
@ -3919,6 +3919,7 @@ rb_str_scan(VALUE str, VALUE pat)
|
|||
VALUE result;
|
||||
long start = 0;
|
||||
VALUE match = Qnil;
|
||||
char *p = RSTRING(str)->ptr; long len = RSTRING(str)->len;
|
||||
|
||||
pat = get_pat(pat, 1);
|
||||
if (!rb_block_given_p()) {
|
||||
|
@ -3936,6 +3937,7 @@ rb_str_scan(VALUE str, VALUE pat)
|
|||
match = rb_backref_get();
|
||||
rb_match_busy(match);
|
||||
rb_yield(result);
|
||||
str_mod_check(str, p, len);
|
||||
rb_backref_set(match); /* restore $~ value */
|
||||
}
|
||||
rb_backref_set(match);
|
||||
|
|
Loading…
Reference in a new issue