summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2005-10-07 18:39:40 +0000
committerWayne Davison <wayned@samba.org>2005-10-07 18:39:40 +0000
commit4fc8140a60c617ec45fd3f57bbbbaa0945a60d55 (patch)
tree2b1150879d23ac932c0764d2ff56b7263effebb8
parent699f7024f1c4f14942723f5fd4de237be8706c65 (diff)
downloadrsync-4fc8140a60c617ec45fd3f57bbbbaa0945a60d55.tar.gz
rsync-4fc8140a60c617ec45fd3f57bbbbaa0945a60d55.tar.bz2
rsync-4fc8140a60c617ec45fd3f57bbbbaa0945a60d55.zip
Support new XFLG_ABS_IF_SLASH flag.
-rw-r--r--exclude.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/exclude.c b/exclude.c
index a83584ab..32fac195 100644
--- a/exclude.c
+++ b/exclude.c
@@ -133,9 +133,9 @@ 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
+ /* These flags also indicate that we're reading a list that
* needs to be filtered now, not post-filtered later. */
- if (xflags & XFLG_ANCHORED2ABS) {
+ if (xflags & (XFLG_ANCHORED2ABS|XFLG_ABS_IF_SLASH)) {
uint32 mf = mflags & (MATCHFLG_RECEIVER_SIDE|MATCHFLG_SENDER_SIDE);
if (am_sender) {
if (mf == MATCHFLG_RECEIVER_SIDE)
@@ -150,10 +150,14 @@ static void add_rule(struct filter_list_struct *listp, const char *pat,
out_of_memory("add_rule");
memset(ret, 0, sizeof ret[0]);
- if (xflags & XFLG_ANCHORED2ABS && *pat == '/'
- && !(mflags & (MATCHFLG_ABS_PATH | MATCHFLG_MERGE_FILE))) {
+ if (!(mflags & (MATCHFLG_ABS_PATH | MATCHFLG_MERGE_FILE))
+ && ((xflags & (XFLG_ANCHORED2ABS|XFLG_ABS_IF_SLASH) && *pat == '/')
+ || (xflags & XFLG_ABS_IF_SLASH && strchr(pat, '/') != NULL))) {
mflags |= MATCHFLG_ABS_PATH;
- ex_len = dirbuf_len - module_dirlen - 1;
+ if (*pat == '/')
+ ex_len = dirbuf_len - module_dirlen - 1;
+ else
+ ex_len = 0;
} else
ex_len = 0;
if (!(ret->pattern = new_array(char, ex_len + pat_len + 1)))