mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-30 16:51:41 +00:00
For -n use decimal point from locale
This commit is contained in:
parent
2c69ba8741
commit
4b97a93ad9
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=93815
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user