develooper Front page | perl.perl5.porters | Postings from June 2019

Re: [perl #134182] Fix test failure in POSIX/t/mb.t with semi-brokenlocales

Thread Previous | Thread Next
From:
Niko Tyni
Date:
June 17, 2019 20:16
Subject:
Re: [perl #134182] Fix test failure in POSIX/t/mb.t with semi-brokenlocales
Message ID:
20190617201553.GA29667@estella.local.invalid
On Mon, Jun 17, 2019 at 07:20:32PM +0300, Niko Tyni wrote:
> On Mon, Jun 17, 2019 at 02:49:43PM +0300, Niko Tyni wrote:
> > On Mon, Jun 17, 2019 at 09:47:04AM +0300, Niko Tyni wrote:

> > #include <locale.h>
> > int main(void) {
> >     char *l;
> >     setlocale(LC_NUMERIC, "C.UTF-8");
> >     l = setlocale(LC_NUMERIC, NULL);
> >     setlocale(LC_NUMERIC, "C");
> >     setlocale(LC_NUMERIC, l);
> > }
> 
> Presumably the intervening setlocale() call clobbers the buffer
> that l points to.
> 
> The attached patch to vutil.c seems to fix this issue for me,
> but eyeballs appreciated of course.

I see vutil.c comes from the version.pm distribution so I've submitted
the patch there as

  https://github.com/Perl/version.pm/pull/7

-- 
Niko

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About