From d4c7114bce116aefe28c899f5d0e7dcc39feb103 Mon Sep 17 00:00:00 2001 From: Pádraig Brady Date: Tue, 29 Sep 2009 15:43:01 +0100 Subject: 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 | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'NEWS') diff --git a/NEWS b/NEWS index f1f73472d..e7e4ddccf 100644 --- a/NEWS +++ b/NEWS @@ -18,12 +18,9 @@ GNU coreutils NEWS -*- outline -*- ls -LR exits with status 2, not 0, when it encounters a cycle - ls -Li is now consistent with ls -Lil in printing "?", not "0" as the - inode of a dangling symlink. - - ls -Li no longer relies on unspecified behavior of stat/lstat. - Before this change, "ls -Li dangling-symlink" would mistakenly - print the inode number of the symlink under some conditions. + ls -is is now consistent with ls -lis in ignoring values returned + from a failed stat/lstat. For example ls -Lis now prints "?", not "0", + for the inode number and allocated size of a dereferenced dangling symlink. ** Portability -- cgit v1.2.3-54-g00ecf