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

* regex.c (read_special): fix parsing backslashes following \c in

regexp.  fixed: [ruby-dev:26500]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2005-07-10 23:32:50 +00:00
parent 0bc99f869c
commit a7e7d310a9
2 changed files with 9 additions and 3 deletions

View file

@ -1,3 +1,8 @@
Mon Jul 11 08:31:29 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* regex.c (read_special): fix parsing backslashes following \c in
regexp. fixed: [ruby-dev:26500]
Sun Jul 10 22:18:17 CEST 2005 Michael Neumann <mneumann@ruby-lang.org>
* lib/xmlrpc/server.rb (XMLRPC::Server): Switch from GServer over to

View file

@ -1162,7 +1162,7 @@ read_special(p, pend, pp)
PATFETCH_RAW(c);
*pp = p;
if (c == '\\') {
return read_special(p, pend, pp) | 0x80;
return read_special(--p, pend, pp) | 0x80;
}
else if (c == -1) return ~0;
else {
@ -1176,12 +1176,13 @@ read_special(p, pend, pp)
PATFETCH_RAW(c);
*pp = p;
if (c == '\\') {
c = read_special(p, pend, pp);
c = read_special(--p, pend, pp);
}
else if (c == '?') return 0177;
else if (c == -1) return ~0;
return c & 0x9f;
default:
*pp = p + 1;
return read_backslash(c);
}
@ -1577,7 +1578,7 @@ re_compile_pattern(pattern, size, bufp)
case 'C':
case 'c':
{
char *pp;
const char *pp;
--p;
c = read_special(p, pend, &pp);