Bug 8731 - Bad column width in ls
Summary: Bad column width in ls
Status: RESOLVED FIXED
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: 1.24.x
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-26 16:54 UTC by Allan Snider
Modified: 2016-03-06 16:54 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments
Correct ls column width (725 bytes, patch)
2016-02-26 16:54 UTC, Allan Snider
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Allan Snider 2016-02-26 16:54:48 UTC
Created attachment 6366 [details]
Correct ls column width

In coreutils/ls.c, 1.19 introduced commit 2f7d9e8903029b1b5e51a15f9cb0dcb6ca17c3ac, removing the variable tabstops and hard coding the column separation to 2 characters, but was not done correctly.  The column_width assumes a gap of 1 character, so the computed number of columns exceeds the terminal width when many small files are encountered.

A minor problem but surprisingly annoying.  A suggested patch is attached.
Comment 1 Denys Vlasenko 2016-03-06 16:54:51 UTC
Fixed in git, thanks!