Bug#568298: balsa: Infinite loop with empty quoted text regexp

Peter Bloomfield peterbloomfield at bellsouth.net
Sun Feb 7 03:17:25 UTC 2010


On 02/06/2010 09:51:04 PM Sat, Karl O. Pinc wrote:
> On 02/05/2010 08:23:50 PM, Peter Bloomfield wrote:
> >
> > On 02/03/2010 01:08:00 PM Wed, Karl O. Pinc wrote:
> 
> > > I want to turn off balsa's colorization and
> > > change bars and other frobbing of quoted text.
> > > Setting the regexp to the empty string
> > > _should_ do this, but does not.
> >
> > Yes, it should--instead it runs afoul of a quirk? feature? in
> > regexec,
> > where an empty regex matches zero characters, and keeps checking
> > forever...fixed in git master.
> 
> FYI FWIW.
> 
> The posix spec (
> http://www.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html
> Section 9.1, first sentence of "matched" sub-section)
> implies that the behavior is correct.
> 
> But the GNU project in man 7 regex says the spec is
> fuzzy and this aspect is non-portable.

Thanks for the reference! Yes, I see now, it's clear that a regex can match zero characters--Balsa's code simply failed in that case. Since we're looking for a leading string that indicates quoting, which requires at least one character, that's essentially a failed match, and that's how Balsa reacts with the fix I mentioned.

Best,

Peter





More information about the pkg-gnome-maintainers mailing list