]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(gobble_file): Also stat the file if it's a
authorJim Meyering <jim@meyering.net>
Fri, 6 Dec 2002 14:16:09 +0000 (14:16 +0000)
committerJim Meyering <jim@meyering.net>
Fri, 6 Dec 2002 14:16:09 +0000 (14:16 +0000)
regular file and --indicator-style=classify (aka -F).

src/ls.c

index 118d706795703177c77e15bd6af952920064cd8e..8092f65c6eaccf45b20b1fe37925e762fe06bb76 100644 (file)
--- 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;