chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Prep v232: Do not listen to SYSTEMD_* environment variables to override things.
[elogind.git]
/
src
/
basic
/
dirent-util.c
diff --git
a/src/basic/dirent-util.c
b/src/basic/dirent-util.c
index 5fb535cb13a2a55f86170747a9d4752b4f400864..59067121b74f0c93c56a27673eeb1c7cfa109e12 100644
(file)
--- a/
src/basic/dirent-util.c
+++ b/
src/basic/dirent-util.c
@@
-52,12
+52,10
@@
int dirent_ensure_type(DIR *d, struct dirent *de) {
bool dirent_is_file(const struct dirent *de) {
assert(de);
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;
return false;
- if (de->d_type != DT_REG &&
- de->d_type != DT_LNK &&
- de->d_type != DT_UNKNOWN)
+ if (hidden_or_backup_file(de->d_name))
return false;
return true;
return false;
return true;
@@
-66,12
+64,10
@@
bool dirent_is_file(const struct dirent *de) {
bool dirent_is_file_with_suffix(const struct dirent *de, const char *suffix) {
assert(de);
bool dirent_is_file_with_suffix(const struct dirent *de, const char *suffix) {
assert(de);
- if (de->d_type != DT_REG &&
- de->d_type != DT_LNK &&
- de->d_type != DT_UNKNOWN)
+ if (!IN_SET(de->d_type, DT_REG, DT_LNK, DT_UNKNOWN))
return false;
return false;
- if (
hidden_file_allow_backup(de->d_name)
)
+ if (
de->d_name[0] == '.'
)
return false;
return endswith(de->d_name, suffix);
return false;
return endswith(de->d_name, suffix);