MCPcopy Create free account
hub / github.com/RsyncProject/rsync / check_filter

Function check_filter

exclude.c:1038–1065  ·  view source on GitHub ↗

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. */

Source from the content-addressed store, hash-verified

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. */
1038int 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

Callers 3

name_is_excludedFunction · 0.70
check_server_filterFunction · 0.70
parse_filter_fileFunction · 0.70

Calls 2

rule_matchesFunction · 0.85
report_filter_resultFunction · 0.85

Tested by

no test coverage detected