GNU bug report logs - #79347
Bad formatting for ls with block-size 'k

Previous Next

Package: coreutils;

Reported by: Peter Laan <plaan70 <at> gmail.com>

Date: Sat, 30 Aug 2025 14:09:02 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Full log


Message #10 received at 79347-done <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Peter Laan <plaan70 <at> gmail.com>, 79347-done <at> debbugs.gnu.org
Subject: Re: bug#79347: Bad formatting for ls with block-size 'k
Date: Sun, 31 Aug 2025 14:36:06 +0100
[Message part 1 (text/plain, inline)]
On 30/08/2025 09:15, Peter Laan wrote:
> Hi,
> 
> I'm a GNU/Linux noob so maybe I'm doing something wrong. But see the
> attached image for badly formatted output from ls -s1 --block-size=\'k. The
> columns are not always aligned. This only happens when you have large files
> in the directory. Everything looks fine with --block-size=k.
> 
> I'm running Arch with the latest updates. ls version 9.7.

The issue is that printf("*s", width, multi_byte_string) doesn't count
width appropriately. In your sv_SE.UTF-8 locale, the number grouping
character is 3 UTF8 bytes which messes up the alignment.

The attached should address this,
which I'll push later today.

Marking this as done.

thanks,
Padraig
[ls-block-align.patch (text/x-patch, attachment)]

This bug report was last modified 6 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.