testsuite: MODTEST_OVERRIDE_ROOT conversion fixup
[mit.git] / config_filter.c
blob7c185bbd07b54a840be321b25c018ae73ffa95a4
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 NULL
15 static const char *const skip_suffix[] = {
16 ".rpmsave",
17 ".rpmorig",
18 ".rpmnew",
19 ".dpkg-old",
20 ".dpkg-dist",
21 ".dpkg-new",
22 ".dpkg-bak",
23 ".bak",
24 ".orig",
25 ".rej",
26 ".YaST2save",
27 ".-",
28 "~",
29 ",v",
30 NULL
33 for (p = skip_prefix; *p; p++) {
34 if (strncmp(name, *p, strlen(*p)) == 0)
35 return 0;
38 for (p = skip_suffix; *p; p++) {
39 if (strlen(name) >= strlen(*p) &&
40 strcmp(*p, strchr(name, 0) - strlen(*p)) == 0)
41 return 0;
44 return 1;