diff options
author | ache <ache@FreeBSD.org> | 2002-04-04 20:54:44 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2002-04-04 20:54:44 +0000 |
commit | 4ca17c54a379a9078a74f29d8d42cf1ddeae30ff (patch) | |
tree | 2e97e23843c193a05e41c103c8064defb4df23cd | |
parent | 5c3c6df21bc7cac65327d5cf901fa6f843de5bc6 (diff) | |
download | FreeBSD-src-4ca17c54a379a9078a74f29d8d42cf1ddeae30ff.zip FreeBSD-src-4ca17c54a379a9078a74f29d8d42cf1ddeae30ff.tar.gz |
For -n use decimal point from locale
-rw-r--r-- | usr.bin/sort/fields.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/sort/fields.c b/usr.bin/sort/fields.c index 49b7bfe..e167f1c 100644 --- a/usr.bin/sort/fields.c +++ b/usr.bin/sort/fields.c @@ -50,6 +50,8 @@ __SCCSID("@(#)fields.c 8.1 (Berkeley) 6/6/93"); #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); +#include <locale.h> + #define blancmange(ptr) { \ if (BLANK & d_mask[*(ptr)]) \ while (BLANK & d_mask[*(++(ptr))]); \ @@ -67,7 +69,6 @@ static u_char *number(u_char *, u_char *, u_char *, u_char *, int); extern struct coldesc clist[(ND+1)*2]; extern int ncols; -#define DECIMAL '.' #define OFFSET 128 u_char TENS[10]; /* TENS[0] = REC_D <= 128 ? 130 - '0' : 2 -'0'... */ @@ -231,7 +232,10 @@ number(pos, bufend, line, lineend, Rflag) int bite, expsign = 1, sign = 1; u_char lastvalue, *nonzero, *tline, *C_TENS; u_char *nweights; + static char DECIMAL = 0; + if (!DECIMAL) + DECIMAL = localeconv()->decimal_point[0]; if (Rflag) nweights = rnum; else |