2000-01-29 Ulrich Drepper <drepper@redhat.com>
* locale/programs/ld-monetary.c (STR_ELEM_WC): Fix test for too
- long string in definition.
+ long string in definition.Only enable returning wide character
+ strings if really needed.
* locale/programs/ld-numeric.c (STR_ELEM): Likewise.
* configure.in: Add check for recent enough sed version.
if (lr != NULL)
{
lr->translate_strings = 1;
- lr->return_widestr = 1;
+ lr->return_widestr = 0;
}
}
struct charmap_t *charmap, const char *repertoire_name,
int ignore_content)
{
+ struct repertoire_t *repertoire = NULL;
struct locale_monetary_t *monetary;
struct token *now;
enum token_t nowtok;
+ /* Get the repertoire we have to use. */
+ if (repertoire_name != NULL)
+ repertoire = repertoire_read (repertoire_name);
+
/* The rest of the line containing `LC_MONETARY' must be free. */
lr_ignore_rest (ldfile, 1);
break; \
} \
\
- now = lr_token (ldfile, charmap, NULL); \
+ ldfile->return_widestr = 1; \
+ now = lr_token (ldfile, charmap, repertoire); \
if (now->tok != tok_string) \
goto err_label; \
if (monetary->cat != NULL) \
if (now->val.str.startwc != NULL) \
monetary->cat##_wc = *now->val.str.startwc; \
} \
+ ldfile->return_widestr = 0; \
break
STR_ELEM_WC (mon_decimal_point);
if (lr != NULL)
{
lr->translate_strings = 1;
- lr->return_widestr = 1;
+ lr->return_widestr = 0;
}
}
struct charmap_t *charmap, const char *repertoire_name,
int ignore_content)
{
+ struct repertoire_t *repertoire = NULL;
struct locale_numeric_t *numeric;
struct token *now;
enum token_t nowtok;
+ /* Get the repertoire we have to use. */
+ if (repertoire_name != NULL)
+ repertoire = repertoire_read (repertoire_name);
+
/* The rest of the line containing `LC_NUMERIC' must be free. */
lr_ignore_rest (ldfile, 1);
break; \
} \
\
- now = lr_token (ldfile, charmap, NULL); \
+ ldfile->return_widestr = 1; \
+ now = lr_token (ldfile, charmap, repertoire); \
if (now->tok != tok_string) \
goto err_label; \
if (numeric->cat != NULL) \
if (now->val.str.startwc != NULL) \
numeric->cat##_wc = *now->val.str.startwc; \
} \
+ ldfile->return_widestr = 0; \
break
STR_ELEM (decimal_point);