emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#51669: closed (some patterns which should match 0x0 don’t do so)


From: GNU bug Tracking System
Subject: bug#51669: closed (some patterns which should match 0x0 don’t do so)
Date: Mon, 08 Nov 2021 00:38:01 +0000

Your message dated Sun, 7 Nov 2021 16:37:17 -0800
with message-id <1158bc7b-f8d4-e692-1af0-1767edf7b630@cs.ucla.edu>
and subject line Re: bug#51669: some patterns which should match 0x0 don’t do so
has caused the debbugs.gnu.org bug report #51669,
regarding some patterns which should match 0x0 don’t do so
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
51669: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=51669
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: some patterns which should match 0x0 don’t do so Date: Sun, 07 Nov 2021 17:56:56 +0100 User-agent: Evolution 3.42.0-2
Hey.

Maybe this is no a bug at all due grep rather being focused on text
files and 0x0 being special anyway, but just for your information:



$ hd test-with-0x00-and-0x02 
00000000  66 6f 6f 0a 62 61 72 0a  7a 65 02 00 0a 62 61 7a  |foo.bar.ze...baz|
00000010  0a 7a 65 72 00 0a 65 6e  64 0a                    |.zer..end.|
0000001a

If one now does:
$ grep '[^[:alnum:][:space:][:punct:]]' test-with-0x00-and-0x02
grep: test-with-0x00-and-0x02: binary file matches

it matches, presumably only the 0x02, though.


Having only 0x00 in the file:
$ hd test-with-0x00-only
00000000  66 6f 6f 0a 62 61 72 0a  7a 65 72 00 0a 62 61 7a  |foo.bar.zer..baz|
00000010  0a 7a 65 72 00 0a 65 6e  64 0a                    |.zer..end.|
0000001a

doesn’t cause a match:
$ grep '[^[:alnum:][:space:][:punct:]]' test-with-0x00-only
$

while naively I'd have assume that 0x00 should be matched as well.


Cheers,
Chris.



--- End Message ---
--- Begin Message --- Subject: Re: bug#51669: some patterns which should match 0x0 don’t do so Date: Sun, 7 Nov 2021 16:37:17 -0800 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.1
That's a feature not a bug; see:

https://www.gnu.org/software/grep/manual/html_node/File-and-Directory-Selection.html

and look for --binary-files. You can use 'grep -a' to pay more attention to binary data.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]