This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f1d6d3c
)
regcomp.c: When inverting a [], adjust bit count
author
Karl Williamson
<public@khwilliamson.com>
Tue, 7 Dec 2010 22:21:55 +0000
(15:21 -0700)
committer
Karl Williamson
<public@khwilliamson.com>
Sat, 11 Dec 2010 22:57:53 +0000
(15:57 -0700)
When one complements every bit, the count of those that are set should
be complemented as well.
regcomp.c
patch
|
blob
|
blame
|
history
diff --git
a/regcomp.c
b/regcomp.c
index
e450ec2
..
0e3f6ba
100644
(file)
--- 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;
}