modindex: simplify option handling
[mit.git] / config_filter.c
blob7d5bbe5223ce79a9a88e6061c8e4ae994a4df580
1 #include <string.h>
3 #include "util.h"
4 #include "config_filter.h"
6 int config_filter(const char *name)
8 const char *const *p;
10 static const char *const skip_prefix[] = {
11 ".",
12 "~",
13 "CVS",
14 NULL
17 static const char *const skip_suffix[] = {
18 ".rpmsave",
19 ".rpmorig",
20 ".rpmnew",
21 ".dpkg-old",
22 ".dpkg-dist",
23 ".dpkg-new",
24 ".dpkg-bak",
25 ".bak",
26 ".orig",
27 ".rej",
28 ".YaST2save",
29 ".-",
30 "~",
31 ",v",
32 NULL
35 for (p = skip_prefix; *p; p++) {
36 if (strstarts(name, *p))
37 return 0;
40 for (p = skip_suffix; *p; p++) {
41 if (strlen(name) >= strlen(*p) &&
42 streq(*p, strchr(name, 0) - strlen(*p)))
43 return 0;
46 return 1;