Bug 8731

Summary: Bad column width in ls
Product: Busybox Reporter: Allan Snider <allan.snider>
Component: OtherAssignee: unassigned
Status: RESOLVED FIXED    
Severity: normal CC: busybox-cvs
Priority: P5    
Version: 1.24.x   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Host: Target:
Build:
Attachments: Correct ls column width

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!