mlist: extract DT_* handling, follow symlinks

Closes #172.
pull/173/head
Leah Neukirchen 4 years ago
parent 8d611a8a3d
commit 079e423438

@ -145,7 +145,7 @@ listdir(char *dir)
for (bpos = 0; bpos < nread; bpos += d->d_reclen) { for (bpos = 0; bpos < nread; bpos += d->d_reclen) {
d = (struct linux_dirent64 *)(buf + bpos); d = (struct linux_dirent64 *)(buf + bpos);
if (d->d_type != DT_REG && d->d_type != DT_UNKNOWN) if (!MAIL_DT(d->d_type))
continue; continue;
if (d->d_name[0] == '.') if (d->d_name[0] == '.')
continue; continue;
@ -166,7 +166,7 @@ listdir(char *dir)
if (!fd) if (!fd)
return; return;
while ((d = readdir(fd))) { while ((d = readdir(fd))) {
if (d->d_type != DT_REG && d->d_type != DT_UNKNOWN) if (!MAIL_DT(d->d_type))
continue; continue;
if (d->d_name[0] == '.') if (d->d_name[0] == '.')
continue; continue;

Loading…
Cancel
Save