summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/strfmon.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/stdlib/strfmon.c')
-rw-r--r--lib/libc/stdlib/strfmon.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/libc/stdlib/strfmon.c b/lib/libc/stdlib/strfmon.c
index c0638fc..6b127fd 100644
--- a/lib/libc/stdlib/strfmon.c
+++ b/lib/libc/stdlib/strfmon.c
@@ -391,7 +391,18 @@ __setup_vars(int flags, char *cs_precedes, char *sep_by_space,
struct lconv *lc = localeconv();
- if (flags & IS_NEGATIVE) {
+ if ((flags & IS_NEGATIVE) && (flags & USE_INTL_CURRENCY)) {
+ *cs_precedes = lc->int_n_cs_precedes;
+ *sep_by_space = lc->int_n_sep_by_space;
+ *sign_posn = (flags & PARENTH_POSN) ? 0 : lc->int_n_sign_posn;
+ *signstr = (lc->negative_sign == '\0') ? "-"
+ : lc->negative_sign;
+ } else if (flags & USE_INTL_CURRENCY) {
+ *cs_precedes = lc->int_p_cs_precedes;
+ *sep_by_space = lc->int_p_sep_by_space;
+ *sign_posn = (flags & PARENTH_POSN) ? 0 : lc->int_p_sign_posn;
+ *signstr = lc->positive_sign;
+ } else if (flags & IS_NEGATIVE) {
*cs_precedes = lc->n_cs_precedes;
*sep_by_space = lc->n_sep_by_space;
*sign_posn = (flags & PARENTH_POSN) ? 0 : lc->n_sign_posn;
OpenPOWER on IntegriCloud