X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/95a44066da8ffc6c37f2c05f2225ae9f2dcf4caf..6e6daf5ac6a4c5a5652dc61c9159143096faca22:/flist.c diff --git a/flist.c b/flist.c index 688117c9..6963b464 100644 --- a/flist.c +++ b/flist.c @@ -1791,16 +1791,11 @@ struct file_list *send_file_list(int f, int argc, char *argv[]) dirlen = dir ? strlen(dir) : 0; if (dirlen != lastdir_len || memcmp(lastdir, dir, dirlen) != 0) { if (!push_pathname(dir ? strdup(dir) : NULL, dirlen)) - goto push_error; + continue; lastdir = pathname; lastdir_len = pathname_len; - } else if (!push_pathname(lastdir, lastdir_len)) { - push_error: - io_error |= IOERR_GENERAL; - rsyserr(FERROR, errno, "push_dir %s failed in %s", - full_fname(dir), curr_dir); + } else if (!push_pathname(lastdir, lastdir_len)) continue; - } if (fn != fbuf) memmove(fbuf, fn, len + 1); @@ -2303,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 - * 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)