summaryrefslogtreecommitdiff
path: root/ls-files.c
diff options
context:
space:
mode:
Diffstat (limited to 'ls-files.c')
-rw-r--r--ls-files.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ls-files.c b/ls-files.c
index 90b289f03d..df25c8c012 100644
--- a/ls-files.c
+++ b/ls-files.c
@@ -279,8 +279,11 @@ static void read_directory(const char *path, const char *base, int baselen)
continue;
len = strlen(de->d_name);
memcpy(fullname + baselen, de->d_name, len+1);
- if (excluded(fullname) != show_ignored)
- continue;
+ if (excluded(fullname) != show_ignored) {
+ if (!show_ignored || DTYPE(de) != DT_DIR) {
+ continue;
+ }
+ }
switch (DTYPE(de)) {
struct stat st;