Fix empty string matching bug.
This commit is contained in:
parent
1e6edd2e33
commit
1d44822484
|
@ -151,6 +151,10 @@ overflows.
|
||||||
38. The table entry for \l in EBCDIC environments was incorrect, leading to its
|
38. The table entry for \l in EBCDIC environments was incorrect, leading to its
|
||||||
being treated as a literal 'l' instead of causing an error.
|
being treated as a literal 'l' instead of causing an error.
|
||||||
|
|
||||||
|
39. If a non-capturing group containing a conditional group that could match
|
||||||
|
an empty string was repeated, it was not identified as matching an empty string
|
||||||
|
itself. For example: /^(?:(?(1)x|)+)+$()/.
|
||||||
|
|
||||||
|
|
||||||
Version 10.10 06-March-2015
|
Version 10.10 06-March-2015
|
||||||
---------------------------
|
---------------------------
|
||||||
|
|
|
@ -1338,7 +1338,7 @@ for (code = first_significant_code(code + PRIV(OP_lengths)[*code], TRUE);
|
||||||
if (c == OP_BRA || c == OP_BRAPOS ||
|
if (c == OP_BRA || c == OP_BRAPOS ||
|
||||||
c == OP_CBRA || c == OP_CBRAPOS ||
|
c == OP_CBRA || c == OP_CBRAPOS ||
|
||||||
c == OP_ONCE || c == OP_ONCE_NC ||
|
c == OP_ONCE || c == OP_ONCE_NC ||
|
||||||
c == OP_COND)
|
c == OP_COND || c == OP_SCOND)
|
||||||
{
|
{
|
||||||
BOOL empty_branch;
|
BOOL empty_branch;
|
||||||
if (GET(code, 1) == 0) return TRUE; /* Hit unclosed bracket */
|
if (GET(code, 1) == 0) return TRUE; /* Hit unclosed bracket */
|
||||||
|
|
|
@ -4325,4 +4325,6 @@ a random value. /Ix
|
||||||
|
|
||||||
/(?<=|(\,\$(?73591620449005828816)\xa8.{7}){6}\x09)/
|
/(?<=|(\,\$(?73591620449005828816)\xa8.{7}){6}\x09)/
|
||||||
|
|
||||||
|
/^(?:(?(1)x|)+)+$()/B
|
||||||
|
|
||||||
# End of testinput2
|
# End of testinput2
|
||||||
|
|
|
@ -14452,4 +14452,22 @@ Failed: error 162 at offset 4: subpattern name expected
|
||||||
/(?<=|(\,\$(?73591620449005828816)\xa8.{7}){6}\x09)/
|
/(?<=|(\,\$(?73591620449005828816)\xa8.{7}){6}\x09)/
|
||||||
Failed: error 161 at offset 32: number is too big
|
Failed: error 161 at offset 32: number is too big
|
||||||
|
|
||||||
|
/^(?:(?(1)x|)+)+$()/B
|
||||||
|
------------------------------------------------------------------
|
||||||
|
Bra
|
||||||
|
^
|
||||||
|
SBra
|
||||||
|
SCond
|
||||||
|
1 Cond ref
|
||||||
|
x
|
||||||
|
Alt
|
||||||
|
KetRmax
|
||||||
|
KetRmax
|
||||||
|
$
|
||||||
|
CBra 1
|
||||||
|
Ket
|
||||||
|
Ket
|
||||||
|
End
|
||||||
|
------------------------------------------------------------------
|
||||||
|
|
||||||
# End of testinput2
|
# End of testinput2
|
||||||
|
|
Loading…
Reference in New Issue