summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>2002-04-04 20:54:44 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>2002-04-04 20:54:44 +0000
commit4b97a93ad925f159ec5b8c4d1933e34da5cb0b67 (patch)
tree2e97e23843c193a05e41c103c8064defb4df23cd
parent2c69ba8741c70fda02208ce507e4111c5d841a5d (diff)
Notes
-rw-r--r--usr.bin/sort/fields.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/sort/fields.c b/usr.bin/sort/fields.c
index 49b7bfe1a56b..e167f1c7061c 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