Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 09 Jul 2018 13:24:06 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 229641] /usr/bin/printf (so also internal printf in sh) ignores width and precision in %b format
Message-ID:  <bug-229641-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=229641

            Bug ID: 229641
           Summary: /usr/bin/printf (so also internal printf in sh)
                    ignores width and precision in %b format
           Product: Base System
           Version: 11.1-STABLE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: cejkar@fit.vutbr.cz

/usr/bin/printf (so also internal printf in sh) ignores width and precision in
%b format. The change is since commit base r265706 (May 2014), where macro PF()
with width and precision interpretation has been replaced by direct call to
fputs(), so width and precision are ignored now.

Expected result, for example from bash:

bash$ printf "%8.2b" "a\nb\n"
      a

Bad result from /usr/bin/printf and from sh:

sh$ /usr/bin/printf "%8.2b" "a\nb\n"
a
b

sh$ printf "%8.2b" "a\nb\n"
a
b

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


Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-229641-227>