aboutsummaryrefslogtreecommitdiffstats
path: root/exclude.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2006-09-01 00:42:39 +0000
committerWayne Davison <wayned@samba.org>2006-09-01 00:42:39 +0000
commitf167879035940c9bc30b687699fdd309e549b5f5 (patch)
treef49c0c141867de6915f6af2c611208e94e9bcd45 /exclude.c
parent4187572616d8cde172d418329053a2a67529c6ba (diff)
downloadandroid_external_rsync-f167879035940c9bc30b687699fdd309e549b5f5.tar.gz
android_external_rsync-f167879035940c9bc30b687699fdd309e549b5f5.tar.bz2
android_external_rsync-f167879035940c9bc30b687699fdd309e549b5f5.zip
Matt pointed out that the code was not properly dropping excludes
that were read from a per-dir merge file when --delete-excluded is enabled. This additional code fixes that.
Diffstat (limited to 'exclude.c')
-rw-r--r--exclude.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/exclude.c b/exclude.c
index dc1a4754..71bc3bda 100644
--- a/exclude.c
+++ b/exclude.c
@@ -847,6 +847,14 @@ static const char *parse_rule_tok(const char *p, uint32 mflags, int xflags,
exit_cleanup(RERR_SYNTAX);
}
+ /* --delete-excluded turns an un-modified include/exclude into a
+ * sender-side rule. We also affect a per-dir .cvsignore file so
+ * that we are compatible with older protocol versions. */
+ if (delete_excluded
+ && !(new_mflags & (MATCHFLG_RECEIVER_SIDE|MATCHFLG_SENDER_SIDE))
+ && (!(new_mflags & MATCHFLG_PERDIR_MERGE) || new_mflags & MATCHFLG_CVS_IGNORE))
+ new_mflags |= MATCHFLG_SENDER_SIDE;
+
*len_ptr = len;
*mflags_ptr = new_mflags;
return (const char *)s;
@@ -1098,6 +1106,9 @@ static void send_rules(int f_out, struct filter_list_struct *flp)
int elide = 0;
char *p;
+ /* Note we need to check delete_excluded here in addition to
+ * the code in parse_rule_tok() because some rules may have
+ * been added before we found the --delete-excluded option. */
if (ent->match_flags & MATCHFLG_SENDER_SIDE)
elide = am_sender ? 1 : -1;
if (ent->match_flags & MATCHFLG_RECEIVER_SIDE)