1 /* config_filter.c: handle hidden or non-configuration files in config dirs.
3 These functions are called whenever we will parse configuration files to
4 ensure we are not picking up backups, SCM meta data, package artifacts.
5 Eventually all config files will have to follow a convention so these
6 lists of possible exceptions should not have to grow by very much.
12 #include "config_filter.h"
14 int config_filter(const char *name
)
18 static const char *const skip_prefix
[] = {
25 static const char *const skip_suffix
[] = {
43 for (p
= skip_prefix
; *p
; p
++) {
44 if (strstarts(name
, *p
))
48 for (p
= skip_suffix
; *p
; p
++) {
49 if (strlen(name
) >= strlen(*p
) &&
50 streq(*p
, strchr(name
, 0) - strlen(*p
)))