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: Wed, 11 Jan 2023 13:13:19 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

On 2023-01-10 21:37, Jim Meyering wrote:

+  uint32_t unicode = 1;
+  pcre2_config (PCRE2_CONFIG_UNICODE, &unicode);
+  if (unicode && localeinfo.multibyte)

Shouldn't that be:

  uint32_t unicode;
  if (localeinfo.multibyte
      && 0 <= pcre2_config (PCRE2_CONFIG_UNICODE, &unicode)
      && unicode)

That is, don't bother to call pcre2_config in a unibyte locale, and don't initialize 'unicode' (so that valgrind-like tools can detect an error if pcre2_config is buggy), and check the return value of pcre2_config.





reply via email to

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