GNU grep supports POSIX equivalence classes [[=c=]] inside bracket expressions; in the C locale [[=a=]] is equivalent to [a]. uu_grep does not — [[=a=]] matches nothing (silently, no error), and putting one inside a larger bracket expression breaks the whole expression so even its plain members stop matching.
Found by the differential fuzzer (fuzz_grep).
Rust (incorrect)
$ printf 'a\nb\n' | ./target/release/grep '[[=a=]]'
# Output: (none)
# Exit code: 1
GNU (correct)
$ printf 'a\nb\n' | LC_ALL=C /usr/bin/grep '[[=a=]]'
a
# Exit code: 0
The class is poisoned for its other members too: grep '[[=a=]b]' matches a and b in GNU but nothing in uu_grep.
GNU grep supports POSIX equivalence classes
[[=c=]]inside bracket expressions; in the C locale[[=a=]]is equivalent to[a].uu_grepdoes not —[[=a=]]matches nothing (silently, no error), and putting one inside a larger bracket expression breaks the whole expression so even its plain members stop matching.Found by the differential fuzzer (
fuzz_grep).Rust (incorrect)
GNU (correct)
The class is poisoned for its other members too:
grep '[[=a=]b]'matchesaandbin GNU but nothing inuu_grep.