[Bug 280543] df -, isn't columnated if the thousands separator is multi-byte

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 09 Aug 2024 18:09:09 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=280543

--- Comment #5 from наб <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=pl_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=pl_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 the
result (so far it's avoided this problem by the device column being all
7-bit-clean and the mountedon column being last).

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