Wed 20 Jul 2005 05:28:39 PM UTC, comment #2:
Thank you, that version works correctly regardless of locale for me too. The problem seems to be worked around by your dfa_optional patch. If I keep all other patches, but unapply that, it starts failing for me again. After reading http://www.mail-archive.com/bug-grep@gnu.org/msg00068.html I think this is simple luck on your part, since it doesn't appear to be intended to do anything but speed things up :-)
|
Wed 20 Jul 2005 12:52:49 PM UTC, original submission:
Hi,
Firstly, I had originally e-mailed this to bug-gnu-utils@gnu.org, as described in the info page for grep, but since I didn't get any response, and I then found the link here on gnu.org/software/grep/, I thought it'd be best to report this again. My apologies if I should've just waited longer.
When I try to grep '\([A]\|[B]\)\{2\}', and as input I pass AA / AB / BA / BB (yes, on separate lines), in the C locale, grep prints all four lines. However, in UTF-8 locales (specifically en_GB.UTF-8, but I got the same result with some others as well), it only prints the second and fourth line. If I change [B] to B, or [A] to A, or both, grep prints all four lines regardless of locale. If I remove \{2\} and try '\([A]\|[B]\)\([A]\|[B]\)' instead, grep again prints all four lines regardless of locale.
I've tested this with grep 2.5.1 on Linux, configured with nothing more than --prefix=$HOME/grep, compiled with gcc 4.0.1, on a system with glibc 2.3.5 (20050421 snapshot). I also tried --with-included-regex just in case, but this didn't change anything.
Am I correct in assuming this is a bug?
|