|
From: | GNU bug Tracking System |
Subject: | [debbugs-tracker] bug#25336: closed () |
Date: | Mon, 02 Jan 2017 18:31:02 +0000 |
Your message dated Mon, 2 Jan 2017 10:30:32 -0800 with message-id <address@hidden> and subject line Re: bug#25336: has caused the debbugs.gnu.org bug report #25336, regarding to be marked as done. (If you believe you have received this mail in error, please contact address@hidden) -- 25336: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=25336 GNU Bug Tracking System Contact address@hidden with problems
--- Begin Message ---Subject: Date: Mon, 2 Jan 2017 21:22:59 +0800 OS: Archlinuxgrep version: 2.27-1Bug description: grep behaves weirdly when searching hex values.How to reproduce:$ printf '\x53\xef' | grep -aoP '\x53\xef'(no output, returns 1)$ printf '\x53\xc3\xaf' | grep -aoP '\x53\xef'Sï$ printf '\x53\xc3\xef' | grep -aoP '\x53\xef'(no output, returns 1)grep (version 2.12-2) provided by Debian works just fine.
--- End Message ---
--- Begin Message ---Subject: Re: bug#25336: Date: Mon, 2 Jan 2017 10:30:32 -0800 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 Zepp Lu wrote:$ printf '\x53\xef' | grep -aoP '\x53\xef' (no output, returns 1) $ printf '\x53\xc3\xaf' | grep -aoP '\x53\xef' Sï $ printf '\x53\xc3\xef' | grep -aoP '\x53\xef' (no output, returns 1)I don't see a bug here. PCRE patterns like \xef match code points, not bytes, so the PCRE notation differs from the shell printf notation. If your locale uses UTF-8, the PCRE pattern \xef matches the Unicode character U+00EF LATIN SMALL LETTER I WITH DIAERESIS, which is represented by the byte pair C3 AF.If you want \xef to match a single byte, run grep in a single-byte locale, e.g., set LC_ALL=C in the environment.grep (version 2.12-2) provided by Debian works just fine.Actually, it's buggy in this area. Sometimes it can dump core.
--- End Message ---
[Prev in Thread] | Current Thread | [Next in Thread] |