[bug] ls -1 is not SUSv3 compliant (symlinks handling)

Laurent Bercot ska-dietlibc at skarnet.org
Thu Mar 10 11:43:37 UTC 2011


 Hi,

 busybox 1.18.3.
 uClibc (latest native-compiler-i686 toolchain from Aboriginal Linux).

sh-2.05b$ mkdir dir ; touch dir/A dir/B
sh-2.05b$ ln -s dir link
sh-2.05b$ ls link
A  B
sh-2.05b$ ls -1 link/
A
B
sh-2.05b$ ls -1 link  
link


"ls link" produces correct output, as does "ls -1 link/".
However, the output from "ls -1 link" is incorrect.
"ls -1 link" should be similar to "ls -1 link/".

 Single Unix (v3 as well as v4) states:
"If none of the -d, -F, or -l options are specified, or the -H or -L options
are specified, for each operand that names a file of type symbolic link to a
directory, ls shall write the names of files contained within the directory
as well as any requested, associated information."

 Thanks for investigating and fixing this !

-- 
 Laurent


More information about the busybox mailing list