version 1.2.2.1, 2021/11/09 13:40:41 |
version 1.3, 2021/11/03 08:30:14 |
|
|
|
|
struct rule { |
struct rule { |
char *pattern; |
char *pattern; |
enum rule_type type; |
enum rule_type type; |
#ifdef NOTYET |
#ifdef NOTYET |
unsigned int modifiers; |
unsigned int modifiers; |
#endif |
#endif |
short numseg; |
short numseg; |
unsigned char anchored; |
unsigned char anchored; |
|
|
{ |
{ |
const char *mod; |
const char *mod; |
size_t i; |
size_t i; |
|
|
mod = memchr(command, ',', len); |
mod = memchr(command, ',', len); |
if (mod != NULL) { |
if (mod != NULL) { |
/* XXX modifiers not yet implemented */ |
/* XXX modifiers not yet implemented */ |
|
|
nseg++; |
nseg++; |
r->numseg = nseg; |
r->numseg = nseg; |
|
|
/* check if this pattern only matches against the basename */ |
/* check if this pattern only matches against the basename */ |
if (nseg == 1 && !r->anchored) |
if (nseg == 1 && !r->anchored) |
r->fileonly = 1; |
r->fileonly = 1; |
|
|
|
|
return -1; |
return -1; |
type = def; |
type = def; |
pattern = line; |
pattern = line; |
} else |
} else |
pattern = line + len + 1; |
pattern = line + len + 1; |
|
|
if (*pattern == '\0' && type != RULE_CLEAR) |
if (*pattern == '\0' && type != RULE_CLEAR) |
|
|
struct rule *r; |
struct rule *r; |
size_t i; |
size_t i; |
|
|
basename = strrchr(path, '/'); |
basename = strrchr(path, '/'); |
if (basename != NULL) |
if (basename != NULL) |
basename += 1; |
basename += 1; |
else |
else |
basename = path; |
basename = path; |
|
|
for (i = 0; i < numrules; i++) { |
for (i = 0; i < numrules; i++) { |
r = &rules[i]; |
r = &rules[i]; |
|
|