Bug 2959

Summary: busybox ls does not consider an order of mutually exclusive options
Product: Busybox Reporter: Yunho Kim <kimyunho>
Component: Standard ComplianceAssignee: unassigned
Status: RESOLVED FIXED    
Severity: normal CC: busybox-cvs
Priority: P5    
Version: 1.17.x   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Host: Target:
Build:

Description Yunho Kim 2010-12-14 02:16:04 UTC
According to IEEE Std 1003.1 ls section,
-------------------
Specifying more than one of the options in the following mutually-exclusive pairs shall not be considered an error: -C and -l (ell), [XSI]  -m and -l (ell), -x and -l (ell),  -C and -1 (one), -H and -L, -c and -u. The last option specified in each pair shall determine the output format.
-------------------

However, through concolic testing, we found that busybox ls does not follow this standard and ignores the order of mutually exclusive options. For example,

// Standard Linux ls
[moonzoo@verifier ls-bug]$ ls -C1
a.txt
b.txt
[moonzoo@verifier ls-bug]$ ls -1C
a.txt  b.txt

// Busybox ls 
[moonzoo@verifier ls-bug]$ ../busybox-1.17.0/busybox ls -C1
a.txt
b.txt
[moonzoo@verifier ls-bug]$ ../busybox-1.17.0/busybox ls -1C
a.txt
b.txt
Comment 1 Denys Vlasenko 2010-12-19 04:07:06 UTC
Thanks, fixed in git:

http://git.busybox.net/busybox/commit/?id=f313746a6d7b992918386a5e6db1cfc8f4da30fd

Will be in 1.19.x