I wrote:
> No, that patch is just plain wrong. It eats %'s that would affect
> the later recursive MatchText calls.
Hmm ... actually, it's not wrong, but it's not good either. What we
really ought to do here is not just eat _'s following %, but eat *any
mixture of* % and _, advancing over a text character per _. The
subsequent search loop is reached only when we find a literal pattern
character to match. This generalizes the original intention of not
using recursion to deal with simple advancing.
regards, tom lane