Fix regexp parsing with RE_CONTEXT_INDEP_OPS

Jakub Jelinek jakub@redhat.com
Sat Dec 13 10:52:00 GMT 2003


On Sat, Dec 13, 2003 at 10:56:28AM +0100, Andreas Schwab wrote:
> When parsed with RE_SYNTAX_EGREP (which includes RE_CONTEXT_INDEP_OPS)
> the regexp "(*)b" results in the error "unmatched ) or \)", but it
> should compile successfully (treating it as if "()b").  This is part
> of the Spencer tests in grep.

Then please add that into glibc testsuite as well.
IMHO all regex bugfixes should be accompanied by testsuite additions.
I think bug-regex13.c if you want it to use RE_SYNTAX_EGREP or
bug-regex11.c if you want to use REG_EXTENDED (which has
RE_CONTEXT_INDEP_OPS set too) would be natural choice.
Or rxspencer/tests if you think it comes really from Spencer.
What surprises me is that (*)b actually doesn't come from Spencer's
testsuite, at least not rxspencer-alpha3.8.g3.tar.bz2.
The only thing it has in the original is:
a\(*\)b         b       a*b     a*b
(i.e. as BRE).

	Jakub



More information about the Libc-hacker mailing list