summaryrefslogtreecommitdiff
path: root/flist.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2005-04-27 22:56:47 +0000
committerWayne Davison <wayned@samba.org>2005-04-27 22:56:47 +0000
commit7a16e12207b65010dc2f0c05dc87a9690c9ed87b (patch)
treed628557fc5e979b10cc1491c7e1261eed16465e3 /flist.c
parentde8252f67fb4cc22b4c6264ea87c6c43bb3c69d5 (diff)
downloadrsync-7a16e12207b65010dc2f0c05dc87a9690c9ed87b.tar.gz
rsync-7a16e12207b65010dc2f0c05dc87a9690c9ed87b.tar.bz2
rsync-7a16e12207b65010dc2f0c05dc87a9690c9ed87b.zip
If the user specified --relative and a source dir with a trailing
slash, make sure we strip of the trailing "/." from the dir's len (in del_hier_name_len) so that its subdirs get marked with FLAG_DEL_HERE.
Diffstat (limited to 'flist.c')
-rw-r--r--flist.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/flist.c b/flist.c
index fcfde840..29d75cab 100644
--- a/flist.c
+++ b/flist.c
@@ -655,6 +655,9 @@ static struct file_struct *receive_file_entry(struct file_list *flist,
if (flags & XMIT_TOP_DIR) {
in_del_hier = 1;
del_hier_name_len = file->dir.depth == 0 ? 0 : l1 + l2;
+ if (relative_paths && del_hier_name_len > 2
+ && basename_len == 1+1 && *basename == '.')
+ del_hier_name_len -= 2;
file->flags |= FLAG_TOP_DIR | FLAG_DEL_HERE;
} else if (in_del_hier) {
if (!relative_paths || !del_hier_name_len