[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gawk-3.1.4l: uninitialized "struct lconv *loc"
From: |
Aharon Robbins |
Subject: |
Re: gawk-3.1.4l: uninitialized "struct lconv *loc" |
Date: |
Wed, 15 Jun 2005 22:41:40 +0300 |
Hi. Thanks for this note.
In article <address@hidden> you write:
>-=-=-=-=-=-
>
>
> Hi,
>
>the function isnondecimal() during the argv pre-assignments uses
>uninitialized "loc".
>
>$ ./gawk --non-decimal-data -v a=0x1 'BEGIN { print a+0 }'
>gawk: fatal error: internal error
>Aborted
>
>The patch with bug fix is in the mail attachment.
>
> Karel
>
>--
>Karel Zak <address@hidden>
>
>-=-=-=-=-=-
>
>--- gawk-3.1.4l/main.c.locale 2005-06-15 17:58:08.127487440 +0200
>+++ gawk-3.1.4l/main.c 2005-06-15 17:58:25.088908912 +0200
>@@ -248,6 +248,9 @@
> */
> setlocale(LC_NUMERIC, "C");
> #endif
>+#if defined(HAVE_LOCALE_H)
>+ loc = *localeconv(); /* Make a local copy of locale numeric info */
>+#endif
> #if defined(LC_TIME)
> setlocale(LC_TIME, "");
> #endif
>
>-=-=-=-=-=-
This is an incorrect patch. It copies the numeric information for the
"C" locale into the `loc' variable and that variable wants to have the
information for the real locale.
I have fixed the problem by checking in `isnondecimal' that
loc.decimal_point is not null and that loc.decimal_point[0] is not '\0',
in my code for the 3.1.5 release.
In any case, I hope that Fedora 4 is not using my beta code.
Thanks,
Arnold
--
Aharon (Arnold) Robbins --- Pioneer Consulting Ltd. arnold AT skeeve DOT com
P.O. Box 354 Home Phone: +972 8 979-0381 Fax: +1 206 350 8765
Nof Ayalon Cell Phone: +972 50 729-7545
D.N. Shimshon 99785 ISRAEL