Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 09 Aug 2024 18:09:09 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 280543] df -, isn't columnated if the thousands separator is multi-byte
Message-ID:  <bug-280543-227-WO59HZnKum@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-280543-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-280543-227@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D280543

--- Comment #5 from =D0=BD=D0=B0=D0=B1 <nabijaczleweli@nabijaczleweli.xyz> =
---
I mean, idk, probably not? This looks like exactly correct behaviour from
printf(3) (and thus printf(1) I'm pretty sure).

printf(3)'s widths, precisions, and the return value are in bytes (and
wprintf(3)'s would be in wchar_ts), so
  $ out/cmd/printf "%'10d\n" 123456 | wc -L
  10
  $ LC_ALL=3Dpl_PL.UTF-8 out/cmd/printf "%'10d\n" 123456 | wc -L
  8
is entirely correct, because
  $ out/cmd/printf "%'10d\n" 123456 | wc -c
  11
  $ LC_ALL=3Dpl_PL.UTF-8 out/cmd/printf "%'10d\n" 123456 | wc -c
  11

The bug is in df, which needs to actually wcwidth(3)-measure the width of t=
he
result (so far it's avoided this problem by the device column being all
7-bit-clean and the mountedon column being last).

--=20
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-280543-227-WO59HZnKum>