diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-02-14 01:07:01 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-02-14 01:07:01 +0100 |
commit | c85dc17be718014260e10e41d15ba8f7329fed26 (patch) | |
tree | 7a6a41ca48f4bb0a6e073ad1dce0b09acac61f7d /util.c | |
parent | a6a80b4f440bcc1c6087572503c08a72ee674075 (diff) |
util: unify code to check whether certain file names should be ignored when listing files
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -1058,6 +1058,20 @@ char *ascii_strlower(char *path) { return p; } +bool ignore_file(const char *filename) { + assert(filename); + + return + filename[0] == '.' || + endswith(filename, "~") || + endswith(filename, ".rpmnew") || + endswith(filename, ".rpmsave") || + endswith(filename, ".rpmorig") || + endswith(filename, ".dpkg-old") || + endswith(filename, ".dpkg-new") || + endswith(filename, ".swp"); +} + static const char *const ioprio_class_table[] = { [IOPRIO_CLASS_NONE] = "none", [IOPRIO_CLASS_RT] = "realtime", |