X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/3a05c5d3ce89c1ef4c2f12646abb1afac418641a..9819f005b667f938f6853636492665cac761c54f:/flist.c diff --git a/flist.c b/flist.c index c342539e..64ff0077 100644 --- a/flist.c +++ b/flist.c @@ -1471,8 +1471,12 @@ static void clean_flist(struct file_list *flist, int strip_root, int no_dups) { int i, prev_i = 0; - if (!flist || flist->count == 0) + if (!flist) + return; + if (flist->count == 0) { + flist->high = -1; return; + } sorting_flist = flist; qsort(flist->files, flist->count, @@ -1524,9 +1528,8 @@ 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. */ - j = flist->files[drop]->flags & (FLAG_TOP_DIR|FLAG_DEL_HERE); - if (j) - flist->files[keep]->flags |= j; + flist->files[keep]->flags |= flist->files[drop]->flags + & (FLAG_TOP_DIR|FLAG_DEL_HERE); clear_file(drop, flist);