summaryrefslogtreecommitdiff
path: root/pcre_compile.c
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2010-05-03 11:13:37 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2010-05-03 11:13:37 +0000
commit7bd79d3485d19f91b25321744d6c378e25e37228 (patch)
tree19ba809b7c3b24a900491fc37255c1842d9055b4 /pcre_compile.c
parentf519d354b9128f7f7928c0b3143519b230a45703 (diff)
downloadpcre-7bd79d3485d19f91b25321744d6c378e25e37228.tar.gz
Make \R and \X in a character class behave more like Perl
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@513 2f5784b3-3f2a-0410-8824-cb99058d5e15
Diffstat (limited to 'pcre_compile.c')
-rw-r--r--pcre_compile.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/pcre_compile.c b/pcre_compile.c
index b84ff7f..d292825 100644
--- a/pcre_compile.c
+++ b/pcre_compile.c
@@ -3204,19 +3204,18 @@ for (;; ptr++)
/* Backslash may introduce a single character, or it may introduce one
of the specials, which just set a flag. The sequence \b is a special
- case. Inside a class (and only there) it is treated as backspace.
- Elsewhere it marks a word boundary. Other escapes have preset maps ready
- to 'or' into the one we are building. We assume they have more than one
- character in them, so set class_charcount bigger than one. */
+ case. Inside a class (and only there) it is treated as backspace. We
+ assume that other escapes have more than one character in them, so set
+ class_charcount bigger than one. Unrecognized escapes fall through and
+ are either treated as literal characters (by default), or are faulted if
+ PCRE_EXTRA is set. */
if (c == CHAR_BACKSLASH)
{
c = check_escape(&ptr, errorcodeptr, cd->bracount, options, TRUE);
if (*errorcodeptr != 0) goto FAILED;
- if (-c == ESC_b) c = CHAR_BS; /* \b is backspace in a class */
- else if (-c == ESC_X) c = CHAR_X; /* \X is literal X in a class */
- else if (-c == ESC_R) c = CHAR_R; /* \R is literal R in a class */
+ if (-c == ESC_b) c = CHAR_BS; /* \b is backspace in a class */
else if (-c == ESC_Q) /* Handle start of quoted string */
{
if (ptr[1] == CHAR_BACKSLASH && ptr[2] == CHAR_E)