X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/ed243f8c29926327d901adbfeec8cf25947cc88d..4adbb5f24683417a90a1cc00be54e58d2f7a901a:/exclude.c diff --git a/exclude.c b/exclude.c index 9a7a81c3..fa11e449 100644 --- a/exclude.c +++ b/exclude.c @@ -133,6 +133,19 @@ static void add_rule(struct filter_list_struct *listp, const char *pat, listp->debug_type); } + /* This flag also indicates that we're reading a list that + * needs to be filtered now, not post-filtered later. */ + if (xflags & XFLG_ANCHORED2ABS) { + uint32 mf = mflags & (MATCHFLG_RECEIVER_SIDE|MATCHFLG_SENDER_SIDE); + if (am_sender) { + if (mf == MATCHFLG_RECEIVER_SIDE) + return; + } else { + if (mf == MATCHFLG_SENDER_SIDE) + return; + } + } + if (!(ret = new(struct filter_struct))) out_of_memory("add_rule"); memset(ret, 0, sizeof ret[0]); @@ -608,9 +621,9 @@ int check_filter(struct filter_list_struct *listp, char *name, int name_is_dir) #define RULE_STRCMP(s,r) rule_strcmp((s), (r), sizeof (r) - 1) -static const char *rule_strcmp(const char *str, const char *rule, int rule_len) +static const uchar *rule_strcmp(const uchar *str, const char *rule, int rule_len) { - if (strncmp(str, rule, rule_len) != 0) + if (strncmp((char*)str, rule, rule_len) != 0) return NULL; if (isspace(str[rule_len]) || str[rule_len] == '_' || !str[rule_len]) return str + rule_len - 1;