NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: PR/42320 CVS commit: src/dist/nawk



The following reply was made to PR bin/42320; it has been noted by GNATS.

From: Takehiko NOZAKI <takehiko.nozaki%gmail.com@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: PR/42320 CVS commit: src/dist/nawk
Date: Sun, 22 Nov 2009 02:26:35 +0900

 hi, all
 
 > =A0So what should we do? Reset it after the program is parsed? What does
 > =A0gawk do?
 >
 > =A0christos
 >
 >
 
 this bug introduced by merging nawk-20030729 branch.
 
 main.c rev1.3, setlocale(LC_ALL, "") at line 116 was added as NetBSD's
 local change.
 
 but nawk-20030729 had own setlocale(LC_NUMERIC, "C") call at line 107
 (this makes decimal point as '.').
 
 after marging nawk-20030729 at main.c rev1.4, dupilicated
 setlocale(LC_ALL, "") call
 at line 116 causes overwrite LC_NUMERIC, so that decimal point set as
 locale specific
 character.
 
 i think following patch make fix this PR.
 
 Index: main.c
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 RCS file: /cvsroot/src/dist/nawk/main.c,v
 retrieving revision 1.10
 diff -u -r1.10 main.c
 --- main.c     15 Nov 2009 21:56:06 -0000      1.10
 +++ main.c     21 Nov 2009 15:11:34 -0000
 @@ -101,9 +101,8 @@
  int main(int argc, char *argv[])
  {
        const char *fs =3D NULL;
 -      struct lconv *lconv;
 
 -      setlocale(LC_CTYPE, "");
 +      setlocale(LC_ALL, "");
        setlocale(LC_NUMERIC, "C"); /* for parsing cmdline & prog */
        cmdname =3D argv[0];
        if (argc =3D=3D 1) {
 @@ -112,12 +111,6 @@
                  cmdname);
                exit(1);
        }
 -
 -      (void) setlocale(LC_ALL, "");
 -      lconv =3D localeconv();
 -      lconv->decimal_point =3D ".";
 -
 -
  #ifdef SA_SIGINFO
        {
                struct sigaction sa;
 
 
 
 very truly yours.
 --=20
 Takehiko NOZAKI<takehiko.nozaki%gmail.com@localhost>
 


Home | Main Index | Thread Index | Old Index