diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-07-10 23:32:50 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-07-10 23:32:50 +0000 |
| commit | 2415feb5339edca4cd7f1f2178bc769f71a6c8d7 (patch) | |
| tree | 115a81eb2e1177126e49032852cb79d58891db8d /regex.c | |
| parent | b081a84db765d98c8061724f6c8e4baf2185f2be (diff) | |
| download | ruby-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
Diffstat (limited to 'regex.c')
| -rw-r--r-- | regex.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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); |
