diff options
author | Manuel Novoa III <mjn3@codepoet.org> | 2003-09-01 18:32:22 +0000 |
---|---|---|
committer | Manuel Novoa III <mjn3@codepoet.org> | 2003-09-01 18:32:22 +0000 |
commit | cd46bde2a08e7a5bf4a935784a83dcd246762764 (patch) | |
tree | 223e6a279907e9412d33da1204ded7ab55f3c71a /libc | |
parent | f6a604bc1b8db21ebee8f4327205ea878f25ff9d (diff) |
Hack around bg_BG bug; grouping specified but no thousands separator.
Also, disable the locale link_warnings for now, as they generate a
lot of noise when using libstd++.
Diffstat (limited to 'libc')
-rw-r--r-- | libc/misc/locale/locale.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/libc/misc/locale/locale.c b/libc/misc/locale/locale.c index cbed01146..1e79204c0 100644 --- a/libc/misc/locale/locale.c +++ b/libc/misc/locale/locale.c @@ -32,6 +32,11 @@ * Bug in duplocale... collation data wasn't copied. * Bug in newlocale... translate 1<<LC_ALL to LC_ALL_MASK. * Bug in _wchar_utf8sntowcs... fix cut-n-paste error. + * + * Aug 31, 2003 + * Hack around bg_BG bug; grouping specified but no thousands separator. + * Also, disable the locale link_warnings for now, as they generate a + * lot of noise when using libstd++. */ @@ -56,6 +61,14 @@ #include <ctype.h> #include <stdio.h> +#ifdef __UCLIBC_MJN3_ONLY__ +#ifdef L_setlocale +#warning TODO: Make the link_warning()s a config option? +#endif +#endif +#undef link_warning +#define link_warning(A,B) + #undef __LOCALE_C_ONLY #ifndef __UCLIBC_HAS_LOCALE__ #define __LOCALE_C_ONLY @@ -778,8 +791,19 @@ int _locale_set_l(const unsigned char *p, __locale_t base) base->thousands_sep_len = __locale_mbrtowc_l(&base->thousands_sep_wc, base->thousands_sep, base); +#if 1 +#ifdef __UCLIBC_MJN3_ONLY__ +#warning TODO: Remove hack involving grouping without a thousep char (bg_BG). +#endif + assert(base->thousands_sep_len >= 0); + if (base->thousands_sep_len == 0) { + base->grouping = base->thousands_sep; /* empty string */ + } + assert(base->thousands_sep[base->thousands_sep_len] == 0); +#else assert(base->thousands_sep_len > 0); assert(base->thousands_sep[base->thousands_sep_len] == 0); +#endif } /* } else if (i == LC_COLLATE) { */ |