Correct myself a bit: situation is broken not for _all_ numeric LC_MONETARY,

LC_NUMERIC fields, but only for *grouping fields - other fields are converted
to a chars in localeconv(), so final change is:

"-1" -> "127"

127 here is because CHAR_MAX supposed, which is _positive_ (SUSv2 requirement),
not negative as 255. It is still a bit of hack. To find real CHAR_MAX will be
better to sprintf() it once somewhere in static buffer. *grouping parsing
still broken and missing and needs to be implemented.
This commit is contained in:
Andrey A. Chernov 2001-02-10 01:38:18 +00:00
parent 051f867fe1
commit 1506a668dc
2 changed files with 2 additions and 4 deletions

View File

@ -26,7 +26,6 @@
* $FreeBSD$
*/
#include <limits.h>
#include "lmonetary.h"
#include "ldpart.h"
@ -35,7 +34,7 @@ extern int __mlocale_changed;
#define LCMONETARY_SIZE (sizeof(struct lc_monetary_T) / sizeof(char *))
static char empty[] = "";
static char numempty[] = { CHAR_MAX, '\0' };
static char numempty[] = "127"; /* XXX: CHAR_MAX supposed here */
static const struct lc_monetary_T _C_monetary_locale = {
empty , /* int_curr_symbol */

View File

@ -26,7 +26,6 @@
* $FreeBSD$
*/
#include <limits.h>
#include "lnumeric.h"
#include "ldpart.h"
@ -34,7 +33,7 @@ extern int __nlocale_changed;
#define LCNUMERIC_SIZE (sizeof(struct lc_numeric_T) / sizeof(char *))
static char numempty[] = { CHAR_MAX, '\0' };
static char numempty[] = "127"; /* XXX: CHAR_MAX supposed here */
static const struct lc_numeric_T _C_numeric_locale = {
".", /* decimal_point */