What about the inconsistent output? Grep should not print a mixture of text matches and then exits with a binary match and exit code 0:
# ./null-bug-testcase.txt [...] A A A Binary file testfile.txt matches Exit code of grep: 0 This is clearly a bug in my eyes. Is a patch welcome, which fixes this inconsistency? Currently I am analyzing grep in debugging sessions.