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