Line | Branch | Exec | Source |
---|---|---|---|
1 | static const char ignored_extensions[][12] = { | ||
2 | "bak", | ||
3 | "dpkg-backup", | ||
4 | "dpkg-bak", | ||
5 | "dpkg-dist", | ||
6 | "dpkg-new", | ||
7 | "dpkg-old", | ||
8 | "dpkg-remove", | ||
9 | "dpkg-tmp", | ||
10 | "new", | ||
11 | "old", | ||
12 | "orig", | ||
13 | "pacnew", | ||
14 | "pacorig", | ||
15 | "pacsave", | ||
16 | "rpmnew", | ||
17 | "rpmorig", | ||
18 | "rpmsave", | ||
19 | "ucf-dist", | ||
20 | "ucf-new", | ||
21 | "ucf-old", | ||
22 | }; | ||
23 | |||
24 | 267 | static bool is_ignored_extension(StringView sv) | |
25 | { | ||
26 |
2/2✓ Branch 0 taken 66 times.
✓ Branch 1 taken 201 times.
|
267 | if (sv.length < 3 || sv.length >= sizeof(ignored_extensions[0])) { |
27 | return false; | ||
28 | } | ||
29 |
2/2✓ Branch 0 taken 2 times.
✓ Branch 1 taken 64 times.
|
66 | if (sv.data[sv.length - 1] == '~') { |
30 | 2 | sv.length--; | |
31 | } | ||
32 | 66 | const char *e = BSEARCH(&sv, ignored_extensions, ft_compare); | |
33 | 66 | return e != NULL; | |
34 | } | ||
35 |