Source-Changes-HG archive

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

[src/trunk]: src/dist/nawk PR/42320: Alexander Nasonov: According to:



details:   https://anonhg.NetBSD.org/src/rev/ee067953e2bf
branches:  trunk
changeset: 749066:ee067953e2bf
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Nov 15 21:56:06 2009 +0000

description:
PR/42320: Alexander Nasonov: According to:
http://www.opengroup.org/onlinepubs/7990989775/xcu/awk.html
the LC_NUMERIC decimal point recognized is always period. Make it so.

diffstat:

 dist/nawk/main.c |  5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diffs (29 lines):

diff -r 1b8cbdbd93ef -r ee067953e2bf dist/nawk/main.c
--- a/dist/nawk/main.c  Sun Nov 15 21:19:35 2009 +0000
+++ b/dist/nawk/main.c  Sun Nov 15 21:56:06 2009 +0000
@@ -35,7 +35,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include <signal.h>
-#include <locale.h>
 #include "awk.h"
 #include "awkgram.h"
 
@@ -102,6 +101,7 @@
 int main(int argc, char *argv[])
 {
        const char *fs = NULL;
+       struct lconv *lconv;
 
        setlocale(LC_CTYPE, "");
        setlocale(LC_NUMERIC, "C"); /* for parsing cmdline & prog */
@@ -114,6 +114,9 @@
        }
 
        (void) setlocale(LC_ALL, "");
+       lconv = localeconv();
+       lconv->decimal_point = ".";
+
 
 #ifdef SA_SIGINFO
        {



Home | Main Index | Thread Index | Old Index