aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--coreutils/ls.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/coreutils/ls.c b/coreutils/ls.c
index 3eff5a949..fb082f1f3 100644
--- a/coreutils/ls.c
+++ b/coreutils/ls.c
@@ -316,6 +316,9 @@ struct dnode {
316 int dn_rdev_min; 316 int dn_rdev_min;
317// dev_t dn_dev; 317// dev_t dn_dev;
318// blksize_t dn_blksize; 318// blksize_t dn_blksize;
319#if ENABLE_PLATFORM_MINGW32
320 DWORD dn_attr;
321#endif
319}; 322};
320 323
321struct globals { 324struct globals {
@@ -742,6 +745,9 @@ static struct dnode *my_stat(const char *fullname, const char *name, int force_f
742 745
743 /* cur->dstat = statbuf: */ 746 /* cur->dstat = statbuf: */
744 cur->dn_mode = statbuf.st_mode ; 747 cur->dn_mode = statbuf.st_mode ;
748#if ENABLE_PLATFORM_MINGW32
749 cur->dn_attr = statbuf.st_attr ;
750#endif
745 cur->dn_size = statbuf.st_size ; 751 cur->dn_size = statbuf.st_size ;
746#if ENABLE_FEATURE_LS_TIMESTAMPS || ENABLE_FEATURE_LS_SORTFILES 752#if ENABLE_FEATURE_LS_TIMESTAMPS || ENABLE_FEATURE_LS_SORTFILES
747 cur->dn_time = statbuf.st_mtime ; 753 cur->dn_time = statbuf.st_mtime ;
@@ -953,7 +959,13 @@ static struct dnode **scan_one_dir(const char *path, unsigned *nfiles_p)
953 } 959 }
954 fullname = concat_path_file(path, entry->d_name); 960 fullname = concat_path_file(path, entry->d_name);
955 cur = my_stat(fullname, bb_basename(fullname), 0); 961 cur = my_stat(fullname, bb_basename(fullname), 0);
962#if !ENABLE_PLATFORM_MINGW32
956 if (!cur) { 963 if (!cur) {
964#else
965 if (!cur || ((cur->dn_attr & FILE_ATTRIBUTE_HIDDEN) &&
966 !(option_mask32 & (OPT_a|OPT_A)))) {
967 /* skip invalid or hidden files */
968#endif
957 free(fullname); 969 free(fullname);
958 continue; 970 continue;
959 } 971 }