From: Eric Blake Date: Sat, 7 Apr 2007 18:14:07 +0000 (+0200) Subject: Fix a bug in how the LS_COLORS ln=target attribute is handled. X-Git-Tag: v6.9.89~320 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d63623eb7cd6a086e52f58b02fecdd2c41b9e402;p=thirdparty%2Fcoreutils.git Fix a bug in how the LS_COLORS ln=target attribute is handled. * src/ls.c (gobble_file): Use "stat" (not lstat) also when the ln=target attribute applies. Reported by Kirk Kelsey. --- diff --git a/ChangeLog b/ChangeLog index 46b7b02ae0..f95dcfd862 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-04-07 Eric Blake + + Fix a bug in how the LS_COLORS ln=target attribute is handled. + * src/ls.c (gobble_file): Use "stat" (not lstat) also when the + ln=target attribute applies. Reported by Kirk Kelsey. + 2007-04-02 Jim Meyering * src/copy.c (copy_reg): Initialize local "con", before calling diff --git a/src/ls.c b/src/ls.c index abb0a26926..6ee67751be 100644 --- a/src/ls.c +++ b/src/ls.c @@ -2577,7 +2577,8 @@ gobble_file (char const *name, enum filetype type, ino_t inode, || ((print_inode || format_needs_type) && (type == symbolic_link || type == unknown) && (dereference == DEREF_ALWAYS - || (command_line_arg && dereference != DEREF_NEVER))) + || (command_line_arg && dereference != DEREF_NEVER) + || color_symlink_as_referent)) /* Command line dereferences are already taken care of by the above assertion that the inode number is not yet known. */ || (print_inode && inode == NOT_AN_INODE_NUMBER)