summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2002-12-06 14:16:09 +0000
committerJim Meyering <jim@meyering.net>2002-12-06 14:16:09 +0000
commit10fc9c5ee99436f8776f95105ef31e8b15d1448f (patch)
treed80e771c5aadf0cbecf10e443c9abf4499c44856
parent93968df3404df7531e57819a5f7c7fc93183ca09 (diff)
downloadcoreutils-10fc9c5ee99436f8776f95105ef31e8b15d1448f.tar.xz
(gobble_file): Also stat the file if it's a
regular file and --indicator-style=classify (aka -F).
-rw-r--r--src/ls.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/ls.c b/src/ls.c
index 118d70679..8092f65c6 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -2323,8 +2323,20 @@ gobble_file (const char *name, enum filetype type, int explicit_arg,
files[files_index].linkmode = 0;
files[files_index].linkok = 0;
- if (explicit_arg || format_needs_stat
- || (format_needs_type && type == unknown))
+ if (explicit_arg
+ || format_needs_stat
+ || (format_needs_type
+ && (type == unknown
+
+ /* FIXME: remove this disjunct.
+ I don't think we care about symlinks here, but for now
+ this won't make a big performance difference. */
+ || type == symbolic_link
+
+ /* --indicator-style=classify (aka -F)
+ requires that we stat each regular file
+ to see if it's executable. */
+ || (type == normal && indicator_style == classify))))
{
/* `path' is the absolute pathname of this file. */
int val;