summaryrefslogtreecommitdiff
path: root/src/basic/dirent-util.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-04-27 09:24:59 -0400
committerSven Eden <yamakuzure@gmx.net>2017-06-16 10:12:58 +0200
commitda2520e2ee5a89643c3178c94813548de7f6e3d7 (patch)
tree1c86b661808ac240c188e57ba05fbe409bede11b /src/basic/dirent-util.c
parent792902f968872bb5dd8639bc7c6bbfc7831817f5 (diff)
tree-wide: rename hidden_file to hidden_or_backup_file and optimize
In standard linux parlance, "hidden" usually means that the file name starts with ".", and nothing else. Rename the function to convey what the function does better to casual readers. Stop exposing hidden_file_allow_backup which is rather ugly and rewrite hidden_file to extract the suffix first. Note that hidden_file_allow_backup excluded files with "~" at the end, which is quite confusing. Let's get rid of it before it gets used in the wrong place.
Diffstat (limited to 'src/basic/dirent-util.c')
-rw-r--r--src/basic/dirent-util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/basic/dirent-util.c b/src/basic/dirent-util.c
index 5019882a0..59067121b 100644
--- a/src/basic/dirent-util.c
+++ b/src/basic/dirent-util.c
@@ -52,10 +52,10 @@ int dirent_ensure_type(DIR *d, struct dirent *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;
- if (!IN_SET(de->d_type, DT_REG, DT_LNK, DT_UNKNOWN))
+ if (hidden_or_backup_file(de->d_name))
return false;
return true;