summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-07-10 23:32:50 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-07-10 23:32:50 +0000
commita7e7d310a9e352264b043f2b49af7448742f46d9 (patch)
tree115a81eb2e1177126e49032852cb79d58891db8d
parent0bc99f869c36c512c0fbf0e7bff8547beb65e486 (diff)
* 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
-rw-r--r--ChangeLog5
-rw-r--r--regex.c7
2 files changed, 9 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 8b30435..f8bce27 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/regex.c b/regex.c
index 1a53739..a018e07 100644
--- a/regex.c
+++ b/regex.c
@@ -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);