--- Begin Message ---
Subject: |
Bug when grepping a text file with some arbitrary binary data |
Date: |
Wed, 31 Aug 2016 19:26:28 -0700 |
Hello,
Please consider to fix a bug. I'd found it while parsing my huge logs and I was able to localize it to grep's version and small test file
Affected versions:
v2.23 - v2.25 && recent master
Steps to reproduce (use the attached test file):
./grep 31325 test
Actual result:
08-31 17:59:47.844 31325 31398 I ServerResponse2: [afm::msg] parse(): parse bytes, salt=qpih6vh1ck, decoded:
Binary file test matches
Expected result:
A full output of the test file since all lines matches 31325
The versions v2.22 and below are not affected and produces the full file output as expected
Thank you!
Regards,
Alex
test
Description: Binary data
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#24347: Bug when grepping a text file with some arbitrary binary data |
Date: |
Wed, 31 Aug 2016 23:16:36 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 |
Alexey Dubovkin wrote:
*Expected result:*
A full output of the test file since all lines matches 31325
Since you are running 'grep' in a picky locale where that file is not a text
file, grep treats the file as binary data. If you want the file to be treated as
text, then set the locale to something more generous, or use grep -a. Either of
the following shell commands should work with grep 2.25:
LC_ALL=C grep 31325 test
grep -a 31325 test
--- End Message ---