diff options
author | phantom <phantom@FreeBSD.org> | 2001-02-10 15:36:46 +0000 |
---|---|---|
committer | phantom <phantom@FreeBSD.org> | 2001-02-10 15:36:46 +0000 |
commit | d4e3ae3d2b0ba71baec8eaa715b2e04f155901bf (patch) | |
tree | f16898ec334a52d00a42f5c776a5e65c5fb55cf4 /lib/libc/locale/lnumeric.c | |
parent | bab9f921621ed124781eef8abdf07b4bab79169a (diff) | |
download | FreeBSD-src-d4e3ae3d2b0ba71baec8eaa715b2e04f155901bf.zip FreeBSD-src-d4e3ae3d2b0ba71baec8eaa715b2e04f155901bf.tar.gz |
. Fix semantics of grouping (LC_MONETARY::mon_grouping,
LC_NUMERIC::grouping) values.
. Always set __XXX_changed flags then loading numeric & monetary locale
categories to allow localeconv() to use C locale also.
Diffstat (limited to 'lib/libc/locale/lnumeric.c')
-rw-r--r-- | lib/libc/locale/lnumeric.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/libc/locale/lnumeric.c b/lib/libc/locale/lnumeric.c index 0de5a32..8754069 100644 --- a/lib/libc/locale/lnumeric.c +++ b/lib/libc/locale/lnumeric.c @@ -26,14 +26,16 @@ * $FreeBSD$ */ +#include <limits.h> #include "lnumeric.h" #include "ldpart.h" extern int __nlocale_changed; +extern const char * __fix_locale_grouping_str(const char *); #define LCNUMERIC_SIZE (sizeof(struct lc_numeric_T) / sizeof(char *)) -static char numempty[] = "-1"; +static char numempty[] = { CHAR_MAX, '\0' }; static const struct lc_numeric_T _C_numeric_locale = { ".", /* decimal_point */ @@ -50,11 +52,13 @@ __numeric_load_locale(const char *name) { int ret; + __nlocale_changed = 1; ret = __part_load_locale(name, &_numeric_using_locale, numeric_locale_buf, "LC_NUMERIC", LCNUMERIC_SIZE, (const char **)&_numeric_locale); if (!ret) - __nlocale_changed = 1; + _numeric_locale.grouping = + __fix_locale_grouping_str(_numeric_locale.grouping); return ret; } |