X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=util.c;h=9df6af953f0e13d9ce881f442e88a6894ad799c9;hb=a9a1e00af1059a6b8c3e089238870fbf2608c087;hp=496f55166b7f35a1dad171fbe7c2541a97dd7fa8;hpb=65d2ebdc3408c81a947de8712b37b9398d955465;p=elogind.git diff --git a/util.c b/util.c index 496f55166..9df6af953 100644 --- a/util.c +++ b/util.c @@ -585,7 +585,7 @@ int reset_all_signal_handlers(void) { return -errno; } - return 0; + return 0; } char *strstrip(char *s) { @@ -903,8 +903,8 @@ char *xescape(const char *s, const char *bad) { for (f = s, t = r; *f; f++) { - if (*f < ' ' || *f >= 127 || - *f == '\\' || strchr(bad, *f)) { + if ((*f < ' ') || (*f >= 127) || + (*f == '\\') || strchr(bad, *f)) { *(t++) = '\\'; *(t++) = 'x'; *(t++) = hexchar(*f >> 4); @@ -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",