diff --git a/ls-files.c b/ls-files.c
index c533059d0a0cf5969b6d7309ed7840e935eebfe0..df25c8c012a96a8277413ca3a81490b81b7dc067 100644 (file)
--- a/ls-files.c
+++ b/ls-files.c
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;
continue;
error("pathspec '%s' did not match any.",
pathspec[num] + prefix_offset);
+ errors++;
}
return errors ? 1 : 0;
}