diff options
author | Ulrich Drepper <drepper@redhat.com> | 2006-04-26 05:52:58 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2006-04-26 05:52:58 +0000 |
commit | c61a9cfbc48e9d9b719b4bc26fa3d9ce3fbaa964 (patch) | |
tree | 269721de79babbea34af82232ddfe3e734e414bf /stdlib | |
parent | 388df58d9be050a531948d5afb54d6104efa0845 (diff) | |
download | glibc-c61a9cfbc48e9d9b719b4bc26fa3d9ce3fbaa964.zip glibc-c61a9cfbc48e9d9b719b4bc26fa3d9ce3fbaa964.tar.gz glibc-c61a9cfbc48e9d9b719b4bc26fa3d9ce3fbaa964.tar.bz2 |
[BZ #2420]
* stdlib/strfmon_l.c (__vstrfmon_l): Fix handling of ! modifier.
* localedata/Makefile: Add rules to build and run tst-strfmon1.
* localedata/tst-strfmon1.c: New file.
Diffstat (limited to 'stdlib')
-rw-r--r-- | stdlib/strfmon_l.c | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/stdlib/strfmon_l.c b/stdlib/strfmon_l.c index f6d52e0..c9f3a47 100644 --- a/stdlib/strfmon_l.c +++ b/stdlib/strfmon_l.c @@ -486,23 +486,21 @@ __vstrfmon_l (char *s, size_t maxsize, __locale_t loc, const char *format, } if (print_curr_symbol) - { - out_string (currency_symbol); + out_string (currency_symbol); - if (sign_posn == 4) - { - if (sep_by_space == 2) - out_char (space_char); - out_string (sign_string); - if (sep_by_space == 1) - /* POSIX.2 and SUS are not clear on this case, but C99 - says a space follows the adjacent-symbol-and-sign */ - out_char (' '); - } - else - if (sep_by_space == 1) - out_char (space_char); + if (sign_posn == 4) + { + if (print_curr_symbol && sep_by_space == 2) + out_char (space_char); + out_string (sign_string); + if (sep_by_space == 1) + /* POSIX.2 and SUS are not clear on this case, but C99 + says a space follows the adjacent-symbol-and-sign */ + out_char (' '); } + else + if (print_curr_symbol && sep_by_space == 1) + out_char (space_char); } else if (sign_posn != 0 && sign_posn != 2 && sign_posn != 3 @@ -561,12 +559,13 @@ __vstrfmon_l (char *s, size_t maxsize, __locale_t loc, const char *format, || (sign_posn == 0 && sep_by_space == 1)) out_char (space_char); out_nstring (currency_symbol, currency_symbol_len); - if (sign_posn == 4) - { - if (sep_by_space == 2) - out_char (' '); - out_string (sign_string); - } + } + + if (sign_posn == 4) + { + if (sep_by_space == 2) + out_char (' '); + out_string (sign_string); } } |