Return -1 if file "name" is defined to be excluded by the specified * exclude list, 1 if it is included, and 0 if it was not matched. */
| 1036 | /* Return -1 if file "name" is defined to be excluded by the specified |
| 1037 | * exclude list, 1 if it is included, and 0 if it was not matched. */ |
| 1038 | int check_filter(filter_rule_list *listp, enum logcode code, |
| 1039 | const char *name, int name_flags) |
| 1040 | { |
| 1041 | filter_rule *ent; |
| 1042 | |
| 1043 | for (ent = listp->head; ent; ent = ent->next) { |
| 1044 | if (ignore_perishable && ent->rflags & FILTRULE_PERISHABLE) |
| 1045 | continue; |
| 1046 | if (ent->rflags & FILTRULE_PERDIR_MERGE) { |
| 1047 | int rc = check_filter(ent->u.mergelist, code, name, name_flags); |
| 1048 | if (rc) |
| 1049 | return rc; |
| 1050 | continue; |
| 1051 | } |
| 1052 | if (ent->rflags & FILTRULE_CVS_IGNORE) { |
| 1053 | int rc = check_filter(&cvs_filter_list, code, name, name_flags); |
| 1054 | if (rc) |
| 1055 | return rc; |
| 1056 | continue; |
| 1057 | } |
| 1058 | if (rule_matches(name, ent, name_flags)) { |
| 1059 | report_filter_result(code, name, ent, name_flags, listp->debug_type); |
| 1060 | return ent->rflags & FILTRULE_INCLUDE ? 1 : -1; |
| 1061 | } |
| 1062 | } |
| 1063 | |
| 1064 | return 0; |
| 1065 | } |
| 1066 | |
| 1067 | #define RULE_STRCMP(s,r) rule_strcmp((s), (r), sizeof (r) - 1) |
| 1068 |
no test coverage detected