X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/a289f89fbe92410d2a875481197a75668bd31656..5d24ee71ad855c73fe4d86a2721b342abdd8f149:/flist.c diff --git a/flist.c b/flist.c index ad02b898..c342539e 100644 --- a/flist.c +++ b/flist.c @@ -1524,8 +1524,9 @@ static void clean_flist(struct file_list *flist, int strip_root, int no_dups) } /* Make sure that if we unduplicate '.', that we don't * lose track of a user-specified top directory. */ - if (flist->files[drop]->flags & FLAG_TOP_DIR) - flist->files[keep]->flags |= FLAG_TOP_DIR; + j = flist->files[drop]->flags & (FLAG_TOP_DIR|FLAG_DEL_HERE); + if (j) + flist->files[keep]->flags |= j; clear_file(drop, flist); @@ -1680,8 +1681,13 @@ int f_name_cmp(struct file_struct *f1, struct file_struct *f2) break; case s_SLASH: type1 = S_ISDIR(f1->mode) ? t_path : t_ITEM; - state1 = s_BASE; c1 = (uchar*)f1->basename; + if (type1 == t_PATH && *c1 == '.' && !c1[1]) { + type1 = t_ITEM; + state1 = s_TRAILING; + c1 = (uchar*)""; + } else + state1 = s_BASE; break; case s_BASE: state1 = s_TRAILING; @@ -1705,8 +1711,13 @@ int f_name_cmp(struct file_struct *f1, struct file_struct *f2) break; case s_SLASH: type2 = S_ISDIR(f2->mode) ? t_path : t_ITEM; - state2 = s_BASE; c2 = (uchar*)f2->basename; + if (type2 == t_PATH && *c2 == '.' && !c2[1]) { + type2 = t_ITEM; + state2 = s_TRAILING; + c2 = (uchar*)""; + } else + state2 = s_BASE; break; case s_BASE: state2 = s_TRAILING;