summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2010-12-07 15:21:55 -0700
committerKarl Williamson <public@khwilliamson.com>2010-12-11 15:57:53 -0700
commitfed836b3bfd7f84c2054616037d002570c7f407c (patch)
tree16138e6360acfd079680157ade39604942d500ed /regcomp.c
parentf1d6d3cd22e129a9bf34f86ebe89183aad01d216 (diff)
downloadperl-fed836b3bfd7f84c2054616037d002570c7f407c.tar.gz
regcomp.c: When inverting a [], adjust bit count
When one complements every bit, the count of those that are set should be complemented as well.
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/regcomp.c b/regcomp.c
index e450ec2dde..0e3f6ba3d1 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -8933,6 +8933,9 @@ parseit:
if ((ANYOF_FLAGS(ret) & ANYOF_FLAGS_ALL) == ANYOF_INVERT) {
for (value = 0; value < ANYOF_BITMAP_SIZE; ++value)
ANYOF_BITMAP(ret)[value] ^= 0xFF;
+ stored = 256 - stored;
+
+ /* The inversion means that everything above 255 is matched */
ANYOF_FLAGS(ret) = ANYOF_UTF8|ANYOF_UNICODE_ALL;
}