Fix "first code unit" bug.
This commit is contained in:
parent
62d728bb0b
commit
623b497851
|
@ -6219,7 +6219,7 @@ for (;; ptr++)
|
|||
than one can replicate it as reqcu if necessary. If the subpattern has
|
||||
no firstcu, set "none" for the whole branch. In both cases, a zero
|
||||
repeat forces firstcu to "none". */
|
||||
|
||||
|
||||
if (firstcuflags == REQ_UNSET && subfirstcuflags != REQ_UNSET)
|
||||
{
|
||||
if (subfirstcuflags >= 0)
|
||||
|
@ -6750,15 +6750,16 @@ for (;;)
|
|||
we have to abandon the firstcu for the regex, but if there was
|
||||
previously no reqcu, it takes on the value of the old firstcu. */
|
||||
|
||||
if (firstcuflags >= 0 &&
|
||||
(firstcuflags != branchfirstcuflags ||
|
||||
firstcu != branchfirstcu))
|
||||
if (firstcuflags != branchfirstcuflags || firstcu != branchfirstcu)
|
||||
{
|
||||
if (reqcuflags < 0)
|
||||
if (firstcuflags >= 0)
|
||||
{
|
||||
reqcu = firstcu;
|
||||
reqcuflags = firstcuflags;
|
||||
}
|
||||
if (reqcuflags < 0)
|
||||
{
|
||||
reqcu = firstcu;
|
||||
reqcuflags = firstcuflags;
|
||||
}
|
||||
}
|
||||
firstcuflags = REQ_NONE;
|
||||
}
|
||||
|
||||
|
|
|
@ -5698,4 +5698,8 @@ name)/mark
|
|||
A8B
|
||||
A9B
|
||||
|
||||
/(|ab)*?d/
|
||||
abd
|
||||
xyd
|
||||
|
||||
# End of testinput1
|
||||
|
|
|
@ -3995,4 +3995,12 @@ a random value. /Ix
|
|||
|
||||
/abcd/I,no_start_optimize
|
||||
|
||||
/(|ab)*?d/I
|
||||
abd
|
||||
xyd
|
||||
|
||||
/(|ab)*?d/I,no_start_optimize
|
||||
abd
|
||||
xyd
|
||||
|
||||
# End of testinput2
|
||||
|
|
|
@ -9396,4 +9396,11 @@ No match
|
|||
A9B
|
||||
0: A9B
|
||||
|
||||
/(|ab)*?d/
|
||||
abd
|
||||
0: abd
|
||||
1: ab
|
||||
xyd
|
||||
0: d
|
||||
|
||||
# End of testinput1
|
||||
|
|
|
@ -13554,4 +13554,26 @@ Capturing subpattern count = 0
|
|||
Options: no_start_optimize
|
||||
Subject length lower bound = 0
|
||||
|
||||
/(|ab)*?d/I
|
||||
Capturing subpattern count = 1
|
||||
Starting code units: a d
|
||||
Last code unit = 'd'
|
||||
Subject length lower bound = 1
|
||||
abd
|
||||
0: abd
|
||||
1: ab
|
||||
xyd
|
||||
0: d
|
||||
|
||||
/(|ab)*?d/I,no_start_optimize
|
||||
Capturing subpattern count = 1
|
||||
Options: no_start_optimize
|
||||
Last code unit = 'd'
|
||||
Subject length lower bound = 0
|
||||
abd
|
||||
0: abd
|
||||
1: ab
|
||||
xyd
|
||||
0: d
|
||||
|
||||
# End of testinput2
|
||||
|
|
Loading…
Reference in New Issue