Failing alternate regex matching

Mats Erik Andersson ynglingatal at comhem.se
Fri Feb 29 11:24:50 UTC 2008


Hi folks,

I have detected a special situation where uClibc-0.9.28
fails to handle a regular expression correctly. When Busybox
is compiled against glibc there is no problem, but against
uClibc-0.9.28 (for Bering-uC 3.1 and ATNGW100/avr32) the
matching mechanism fails.

The following minimal testing case illustrates the problem:

#### CODE ####
#!/bin/sh

lager=/tmp/tillf

{
echo -e "abab\nbaab\nabba" | egrep '^(a?[ab]|ba){2}$'
echo -e "abab\nbaab\nabba" | egrep '^(ba|a?[ab]){2}$'
} > $lager # | tee $lager

echo "$(wc -l < $lager) matches out of intended 6."
cat $lager
rm $lager
### END OF CODE ###

The interpretation is that a '?' preceding '|' is
incorrectly parsed, but not for the reverse ordering.
The relevant code base has not changed in a long time,
so I expect uClibc-0.9.28 to produce the same error.

Best regards

M E Andersson



More information about the uClibc mailing list