Fixed a problem with duplicate dirs being unduplicated in the list:
authorWayne Davison <wayned@samba.org>
Sat, 15 Sep 2007 16:32:38 +0000 (16:32 +0000)
committerWayne Davison <wayned@samba.org>
Sat, 15 Sep 2007 16:32:38 +0000 (16:32 +0000)
in inc_recurse mode, we must keep the last dir of the duplicates.

flist.c

diff --git a/flist.c b/flist.c
index de5f292..6963b46 100644 (file)
--- a/flist.c
+++ b/flist.c
@@ -2298,14 +2298,11 @@ 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
                        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 (S_ISDIR(file->mode)) {
-                               struct file_struct *fp = flist->sorted[j];
-                               if (!S_ISDIR(fp->mode))
-                                       keep = i, drop = j;
-                               else
-                                       keep = j, drop = i;
-                       } else
+                        * list.  If both are dirs, keep the last one.
+                        * Otherwise keep the first one. */
+                       if (S_ISDIR(file->mode))
+                               keep = i, drop = j;
+                       else
                                keep = j, drop = i;
 
                        if (am_sender)
                                keep = j, drop = i;
 
                        if (am_sender)