bug-grep
[Top][All Lists]
Advanced

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

bug#60708: pcre: improve support for linking with a library without unic


From: Paul Eggert
Subject: bug#60708: pcre: improve support for linking with a library without unicode
Date: Thu, 12 Jan 2023 19:38:52 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0

On 1/11/23 20:03, Carlo Arenas wrote:
Your suggested code doesn't address
that, it merely changes the error message with one that would be IMHO
even less clear and worsens the problem.

In that case let's improve the error message wording; something like the attached patch, say.


Using a non Unicode PCRE library is perfectly fine, and there is no
"undefined behavior" risk, and indeed `grep -P` without the UTF flag
is exactly what the alternate path uses and what is recommended for
speed, so?

It's not a question of undefined behavior. It's a question of whether grep does what the user requested. Without the attached patch, in a UTF-8 locale "grep -P '[[:alpha:]]'" won't report matching alphabetic characters, if they're multibyte. Silent misbehavior is quite bad, and it's better for grep to issue a diagnostic and exit than to silently do the wrong thing.

Attachment: 0001-grep-diagnose-no-UTF-8-support-Bug-60708.patch
Description: Text Data


reply via email to

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