GNU bug report logs - #60708
pcre: improve support for linking with a library without unicode

Previous Next

Package: grep;

Reported by: Carlo Arenas <carenas <at> gmail.com>

Date: Tue, 10 Jan 2023 11:14:02 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Jim Meyering <jim <at> meyering.net>, Carlo Arenas <carenas <at> gmail.com>
Cc: 60708 <at> debbugs.gnu.org
Subject: bug#60708: pcre: improve support for linking with a library without unicode
Date: Wed, 11 Jan 2023 13:13:19 -0800
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.




This bug report was last modified 2 years and 154 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.