TODO: fix the build system with respect to docs.
[mit.git] / config_filter.c
blobb9ff5a83a1119fe7df2589eee8a6753afcf89cf1
1 #include "config_filter.h"
3 #include <string.h>
5 int config_filter(const char *name)
7 const char *const *p;
9 static const char *const skip_prefix[] = {
10 ".",
11 "~",
12 "CVS",
13 NULL
16 static const char *const skip_suffix[] = {
17 ".rpmsave",
18 ".rpmorig",
19 ".rpmnew",
20 ".dpkg-old",
21 ".dpkg-dist",
22 ".dpkg-new",
23 ".dpkg-bak",
24 ".bak",
25 ".orig",
26 ".rej",
27 ".YaST2save",
28 ".-",
29 "~",
30 ",v",
31 NULL
34 for (p = skip_prefix; *p; p++) {
35 if (strncmp(name, *p, strlen(*p)) == 0)
36 return 0;
39 for (p = skip_suffix; *p; p++) {
40 if (strlen(name) >= strlen(*p) &&
41 strcmp(*p, strchr(name, 0) - strlen(*p)) == 0)
42 return 0;
45 return 1;