summaryrefslogtreecommitdiff
path: root/src/ls.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2003-01-14 16:22:55 +0000
committerJim Meyering <jim@meyering.net>2003-01-14 16:22:55 +0000
commit642bc1acfb41bc0c4d6d9e286b8975336c211659 (patch)
treef6bed4f6b6218f29432a2d752b08b344a657747a /src/ls.c
parent0c28dd98083d0f67b72ceee241f14aaad89fec98 (diff)
downloadcoreutils-642bc1acfb41bc0c4d6d9e286b8975336c211659.tar.xz
(gobble_file): Fix a bug introduced in 4.5.4 that made it
so that ls --color would no longer highlight the names of files with the execute bit set when not specified on the command line. Patch by Michael Stone. Reported by Stephen Depooter as Debian bug 175135.
Diffstat (limited to 'src/ls.c')
-rw-r--r--src/ls.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/ls.c b/src/ls.c
index a8029a4bf..4b60d1869 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -1,5 +1,5 @@
/* `dir', `vdir' and `ls' directory listing programs for GNU.
- Copyright (C) 85, 88, 90, 91, 1995-2002 Free Software Foundation, Inc.
+ Copyright (C) 85, 88, 90, 91, 1995-2003 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -2328,7 +2328,13 @@ gobble_file (const char *name, enum filetype type, int explicit_arg,
/* --indicator-style=classify (aka -F)
requires that we stat each regular file
to see if it's executable. */
- || (type == normal && indicator_style == classify))))
+ || (type == normal && (indicator_style == classify
+ /* This is so that --color ends up
+ highlighting files with the executable
+ bit set even when options like -F are
+ not specified. */
+ || print_with_color)))))
+
{
/* `path' is the absolute pathname of this file. */
int val;