summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorGeequlim <geequlim@gmail.com>2019-07-21 11:48:53 +0800
committerGitHub <noreply@github.com>2019-07-21 11:48:53 +0800
commitee9f46423b85d6fbcfa43380c70cc7d0f3eff8f7 (patch)
tree6ad0f82245511892ad8e378d56547aa2aa7e6b8e /drivers
parent437939589234559febabb9a4c392145521a9c3a5 (diff)
Revert "Optimize DirAccessUnix::get_next() for some file systems"
Diffstat (limited to 'drivers')
-rw-r--r--drivers/unix/dir_access_unix.cpp24
1 files changed, 10 insertions, 14 deletions
diff --git a/drivers/unix/dir_access_unix.cpp b/drivers/unix/dir_access_unix.cpp
index d5582d00ed..251bab5783 100644
--- a/drivers/unix/dir_access_unix.cpp
+++ b/drivers/unix/dir_access_unix.cpp
@@ -136,31 +136,27 @@ String DirAccessUnix::get_next() {
return "";
}
- String fname = fix_unicode_name(entry->d_name);
-
- if (entry->d_type == DT_UNKNOWN) {
- //typedef struct stat Stat;
- struct stat flags;
-
- String f = current_dir.plus_file(fname);
+ //typedef struct stat Stat;
+ struct stat flags;
- if (stat(f.utf8().get_data(), &flags) == 0) {
+ String fname = fix_unicode_name(entry->d_name);
- if (S_ISDIR(flags.st_mode)) {
+ String f = current_dir.plus_file(fname);
- _cisdir = true;
+ if (stat(f.utf8().get_data(), &flags) == 0) {
- } else {
+ if (S_ISDIR(flags.st_mode)) {
- _cisdir = false;
- }
+ _cisdir = true;
} else {
_cisdir = false;
}
+
} else {
- _cisdir = (entry->d_type == DT_DIR);
+
+ _cisdir = false;
}
_cishidden = (fname != "." && fname != ".." && fname.begins_with("."));