about summary refs log tree commit diff
path: root/seq.c
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2020-03-08 17:20:23 +0100
committerLeah Neukirchen <leah@vuxu.org>2020-03-08 17:20:23 +0100
commitdfc18e0040c64fac0318cc9c5964e3a923fa8029 (patch)
treeea93fedf713fb3199dc072497573fe27b2b7c61b /seq.c
parent48b490f3793ec438a7fa15ae249d98e4871d34cd (diff)
downloadmblaze-dfc18e0040c64fac0318cc9c5964e3a923fa8029.tar.gz
mblaze-dfc18e0040c64fac0318cc9c5964e3a923fa8029.tar.xz
mblaze-dfc18e0040c64fac0318cc9c5964e3a923fa8029.zip
seq: extract DT_* handling, follow symlinks
Diffstat (limited to 'seq.c')
-rw-r--r--seq.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/seq.c b/seq.c
index c1f0694..6ae7dad 100644
--- a/seq.c
+++ b/seq.c
@@ -501,12 +501,8 @@ iterdir(char *dir, void (*cb)(char *))
 
 	long i = 0;
 	for (i = 0; i < n; i++) {
-		if (namelist[i]->d_name[0] != '.')
-#if defined(DT_REG) && defined(DT_UNKNOWN)
-		if (namelist[i]->d_type == DT_REG ||
-		    namelist[i]->d_type == DT_UNKNOWN)
-#endif
-		{
+		if (namelist[i]->d_name[0] != '.' &&
+		    MAIL_DT(namelist[i]->d_type)) {
 			snprintf(sub, sizeof sub, "%s%s/%s",
 			    dir, m, namelist[i]->d_name);
 			cb(sub);