bool dirent_is_file(const struct dirent *de) {
assert(de);
- if (hidden_file(de->d_name))
+ if (!IN_SET(de->d_type, DT_REG, DT_LNK, DT_UNKNOWN))
return false;
- if (!IN_SET(de->d_type, DT_REG, DT_LNK, DT_UNKNOWN))
+ if (hidden_or_backup_file(de->d_name))
return false;
return true;