diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | pcre_compile.c | 4 | ||||
-rw-r--r-- | testdata/testinput4 | 3 | ||||
-rw-r--r-- | testdata/testoutput4 | 4 |
4 files changed, 14 insertions, 2 deletions
@@ -27,6 +27,11 @@ ported from PCRE2). 4. Typo LCC_ALL for LC_ALL fixed in pcregrep. +5. In a pattern such as /[^\x{100}-\x{ffff}]*[\x80-\xff]/ which has a repeated +negative class with no characters less than 0x100 followed by a positive class +with only characters less than 0x100, the first class was incorrectly being +auto-possessified, causing incorrect match failures. + Version 8.42 20-March-2018 -------------------------- diff --git a/pcre_compile.c b/pcre_compile.c index 6dd8886..3991d6c 100644 --- a/pcre_compile.c +++ b/pcre_compile.c @@ -6,7 +6,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel - Copyright (c) 1997-2016 University of Cambridge + Copyright (c) 1997-2018 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -3299,7 +3299,7 @@ for(;;) if ((*xclass_flags & XCL_MAP) == 0) { /* No bits are set for characters < 256. */ - if (list[1] == 0) return TRUE; + if (list[1] == 0) return (*xclass_flags & XCL_NOT) == 0; /* Might be an empty repeat. */ continue; } diff --git a/testdata/testinput4 b/testdata/testinput4 index 8bdbdac..63368c0 100644 --- a/testdata/testinput4 +++ b/testdata/testinput4 @@ -727,4 +727,7 @@ /\C(\W?ſ)'?{{/8 \\C(\\W?ſ)'?{{ +/[^\x{100}-\x{ffff}]*[\x80-\xff]/8 + \x{99}\x{99}\x{99} + /-- End of testinput4 --/ diff --git a/testdata/testoutput4 b/testdata/testoutput4 index d43c123..69e812c 100644 --- a/testdata/testoutput4 +++ b/testdata/testoutput4 @@ -1277,4 +1277,8 @@ No match \\C(\\W?ſ)'?{{ No match +/[^\x{100}-\x{ffff}]*[\x80-\xff]/8 + \x{99}\x{99}\x{99} + 0: \x{99}\x{99}\x{99} + /-- End of testinput4 --/ |