]> git.ipfire.org Git - thirdparty/coreutils.git/commit
ls: always print "?" for allocated size of a dereferenced dangling symlink
authorPádraig Brady <P@draigBrady.com>
Tue, 29 Sep 2009 14:43:01 +0000 (15:43 +0100)
committerPádraig Brady <P@draigBrady.com>
Wed, 30 Sep 2009 14:42:35 +0000 (15:42 +0100)
commitd4c7114bce116aefe28c899f5d0e7dcc39feb103
tree39f8d349167efadb14da112fddfccd98569b8bf4
parentce1069c2151da3fffc70281a14b96034ba15da5a
ls: always print "?" for allocated size of a dereferenced dangling symlink

Previously for `ls -Ls` (but not `ls -Lsl`), we referenced
the st_blocks returned from the previous failed stat() call.
This undefined value was seen to be 0 for dangling symlinks at least.
* src/ls.c (print_file_name_and_frills, length_of_file_name_and_frills):
Don't use st_blocks if the previous stat() failed
* tests/ls/dangle: Add a test case
* NEWS: Mention the fix, and roll up related items into a single entry.
NEWS
src/ls.c
tests/ls/dangle