From e8e9e12c3ad227cb876680dd80de738cd5e376f9 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Sat, 15 Sep 2007 17:00:41 +0000 Subject: [PATCH] Reverting last change for a re-think. --- flist.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/flist.c b/flist.c index 6963b464..6642cf27 100644 --- a/flist.c +++ b/flist.c @@ -2298,16 +2298,20 @@ static void clean_flist(struct file_list *flist, int strip_root) int keep, drop; /* If one is a dir and the other is not, we want to * keep the dir because it might have contents in the - * list. If both are dirs, keep the last one. - * Otherwise keep the first one. */ - if (S_ISDIR(file->mode)) - keep = i, drop = j; - else + * list. Otherwise keep the first one. */ + if (S_ISDIR(file->mode)) { + struct file_struct *fp = flist->sorted[j]; + if (!S_ISDIR(fp->mode)) + keep = i, drop = j; + else { + if (am_sender) + file->flags |= FLAG_DUPLICATE; + keep = j, drop = i; + } + } else keep = j, drop = i; - if (am_sender) - flist->sorted[drop]->flags |= FLAG_DUPLICATE; - else { + if (!am_sender) { if (verbose > 1) { rprintf(FINFO, "removing duplicate name %s from file list (%d)\n", -- 2.34.1