mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* re.c (unescape_nonascii): scan hex up to only 3 characters.
[Bug #12420] [Bug #12423] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
46647ac8df
commit
e45cf75f9a
2 changed files with 7 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Wed May 25 20:50:12 2016 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
|
* re.c (unescape_nonascii): scan hex up to only 3 characters.
|
||||||
|
[Bug #12420] [Bug #12423]
|
||||||
|
|
||||||
Wed May 25 19:07:19 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
|
Wed May 25 19:07:19 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
|
||||||
|
|
||||||
* enc/unicode.c: Handle DOTLESS_i by hand because it isn't involved in folding.
|
* enc/unicode.c: Handle DOTLESS_i by hand because it isn't involved in folding.
|
||||||
|
|
4
re.c
4
re.c
|
@ -2492,8 +2492,8 @@ unescape_nonascii(const char *p, const char *end, rb_encoding *enc,
|
||||||
case '1': case '2': case '3':
|
case '1': case '2': case '3':
|
||||||
case '4': case '5': case '6': case '7': /* \O, \OO, \OOO or backref */
|
case '4': case '5': case '6': case '7': /* \O, \OO, \OOO or backref */
|
||||||
{
|
{
|
||||||
size_t octlen;
|
size_t len = end-(p-1), octlen;
|
||||||
if (ruby_scan_oct(p-1, end-(p-1), &octlen) <= 0177) {
|
if (ruby_scan_oct(p-1, len < 3 ? len : 3, &octlen) <= 0177) {
|
||||||
/* backref or 7bit octal.
|
/* backref or 7bit octal.
|
||||||
no need to unescape anyway.
|
no need to unescape anyway.
|
||||||
re-escaping may break backref */
|
re-escaping may break backref */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue