mirror of
https://github.com/postgres/postgres.git
synced 2026-03-28 05:13:33 -04:00
When the number of allowed iterations is limited (either a "?" quantifier
or a bound expression), the last sub-match has to reach to the end of the
target string. The previous coding here first tried the shortest possible
match (one character, usually) and then gave up and back-tracked if that
didn't work, typically leading to failure to match overall, as shown in
bug #11478 from Christoph Berg. The minimum change to fix that would be to
not decrement k before "goto backtrack"; but that would be a pretty stupid
solution, because we'd laboriously try each possible sub-match length
before finally discovering that only ending at the end can work. Instead,
force the sub-match endpoint limit up to the end for even the first
shortest() call if we cannot have any more sub-matches after this one.
Bug introduced in my rewrite that added the iterdissect logic, commit
|
||
|---|---|---|
| .. | ||
| examples | ||
| isolation | ||
| locale | ||
| mb | ||
| performance | ||
| perl | ||
| regress | ||
| thread | ||
| Makefile | ||