summaryrefslogtreecommitdiffstats
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
commit2415feb5339edca4cd7f1f2178bc769f71a6c8d7 (patch)
tree115a81eb2e1177126e49032852cb79d58891db8d
parentb081a84db765d98c8061724f6c8e4baf2185f2be (diff)
downloadruby-2415feb5339edca4cd7f1f2178bc769f71a6c8d7.tar.gz
ruby-2415feb5339edca4cd7f1f2178bc769f71a6c8d7.tar.xz
ruby-2415feb5339edca4cd7f1f2178bc769f71a6c8d7.zip
* regex.c (read_special): fix parsing backslashes following \c in
regexp. fixed: [ruby-dev:26500] git-svn-id: http://svn.ruby-lang.org/repos/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 8b30435a3..f8bce27c8 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 1a5373932..a018e0781 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);