Standard is at http://pubs.opengroup.org/onlinepubs/9699919799/utilities/grep.html Fairly straightforward changes, description as follows: fastgrep.c: Handle ^$ pattern correctly. Simple test is `echo | grep "^$"` - it should match the single line. grep.c: As described in the standard, "The pattern_list's value shall consist of one or more patterns separated by <newline> characters" util.c: For the purposes of the standard, inaccessible = nonexistent. Also don't match the empty end of the line. Simple test for that: `echo abc#def | grep "^[A-Za-z0-9]*$"` should not match anything. Fix: Patch attached. Patch attached with submission follows: How-To-Repeat: See description for test cases.
This is no longer an issue with either gnugrep or bsdgrep, and should probably be closed ("fixed").