[Bug 267282] [PATCH] strfmon: Attempt to fix some strfmon(3) bugs

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 25 Oct 2022 21:52:11 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=267282

--- Comment #2 from commit-hook@FreeBSD.org ---
A commit in branch main references this bug:

URL:
https://cgit.FreeBSD.org/src/commit/?id=947efadc3d6e778a824618d82f53f061bec69b77

commit 947efadc3d6e778a824618d82f53f061bec69b77
Author:     Jose Luis Duran <jlduran@gmail.com>
AuthorDate: 2022-10-14 23:26:32 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2022-10-25 21:40:17 +0000

    strfmon: Fix alignment when enclosed by parentheses

    Take into consideration the possibility of quantities enclosed by
    parentheses when aligning.

    Matches the examples from The Open Group's:

    Format  Before          After
    %(#5n   [$   123.45]    [ $   123.45 ]  Use an alternative pos/neg style
            [($   123.45)]  [($   123.45)]
            [$ 3,456.78]    [ $ 3,456.78 ]

    %!(#5n  [   123.45]     [    123.45 ]   Disable the currency symbol
            [(   123.45)]   [(   123.45)]
            [ 3,456.78]     [  3,456.78 ]

    https://pubs.opengroup.org/onlinepubs/9699919799/functions/strfmon.html

    SD5-XSH-ERN-29 is applied, updating the examples for %(#5n and %!(#5n.

    Obtained from:  Darwin
    Reviewed by:    kib
    PR:     267282
    Github PR:      #619
    MFC after:      1 week

 lib/libc/stdlib/strfmon.c            | 12 ++++++++++--
 lib/libc/tests/stdlib/strfmon_test.c |  4 ++--
 2 files changed, 12 insertions(+), 4 deletions(-)

-- 
You are receiving this mail because:
You are the assignee for the bug.