- if (ent->match_flags & MATCHFLG_PERDIR_MERGE) {
- char buf[MAX_EXCLUDE_PREFIX], *op = buf;
- if (protocol_version < 29) {
- rprintf(FERROR,
- "remote rsync is too old to understand per-directory merge files.\n");
- exit_cleanup(RERR_SYNTAX);
- }
- *op++ = ':';
- if (ent->match_flags & MATCHFLG_WORD_SPLIT)
- *op++ = 's';
- if (ent->match_flags & MATCHFLG_NO_INHERIT)
- *op++ = 'n';
- if (ent->match_flags & MATCHFLG_EXCLUDE_SELF)
- *op++ = 'e';
- if (ent->match_flags & MATCHFLG_NO_PREFIXES) {
- if (ent->match_flags & MATCHFLG_INCLUDE)
- *op++ = '+';
- else
- *op++ = '-';
- }
- *op++ = ' ';
- if (op - buf > MAX_EXCLUDE_PREFIX)
- overflow("send_exclude_list");
- write_int(f, l + (op - buf));
- write_buf(f, buf, op - buf);
- } else if (ent->match_flags & MATCHFLG_INCLUDE) {
- write_int(f, l + 2);
- write_buf(f, "+ ", 2);
- } else if (protocol_version >= 29
- || ((*p == '-' || *p == '+') && p[1] == ' ')) {
- write_int(f, l + 2);
- write_buf(f, "- ", 2);
- } else
- write_int(f, l);
- write_buf(f, p, l);
+/* This is only called by the client. */
+void send_filter_list(int f_out)
+{
+ int receiver_wants_list = delete_mode
+ && (!delete_excluded || protocol_version >= 29);
+
+ if (local_server || (am_sender && !receiver_wants_list))
+ f_out = -1;
+ if (cvs_exclude && am_sender) {
+ if (protocol_version >= 29)
+ parse_rule(&filter_list, ":C", 0, 0);
+ parse_rule(&filter_list, "-C", 0, 0);