From: Wayne Davison Date: Tue, 22 Feb 2005 03:37:18 +0000 (+0000) Subject: Sort the dir-list returned by get_dirlist() and the dir-list that X-Git-Tag: v2.6.4pre1~18 X-Git-Url: http://git.samba.org/samba.git/?p=rsync.git;a=commitdiff_plain;h=564ef546a92a7588dcd0399c29dfb3914d36435d Sort the dir-list returned by get_dirlist() and the dir-list that delete_in_dir() generates. --- diff --git a/flist.c b/flist.c index 6f94e8c5..4334076a 100644 --- a/flist.c +++ b/flist.c @@ -1767,6 +1767,8 @@ struct file_list *get_dirlist(const char *dirname, int ignore_filter_rules) send_directory(ignore_filter_rules ? -2 : -1, dirlist, dirbuf, dlen); recurse = save_recurse; + clean_flist(dirlist, 0, 0); + return dirlist; } @@ -1836,7 +1838,7 @@ int delete_file(char *fname, int mode, int flags) flags |= DEL_FORCE_RECURSE; dirlist = get_dirlist(fname, 0); - for (j = dirlist->count; j-- > 0; ) { + for (j = dirlist->count; j--; ) { struct file_struct *fp = dirlist->files[j]; f_name_to(fp, buf); if (delete_file(buf, fp->mode, flags & ~DEL_TERSE) != 0) { @@ -1945,6 +1947,8 @@ void delete_in_dir(struct file_list *flist, char *fbuf, recurse = -1; fbuf[dlen] = '\0'; + clean_flist(dir_list, 0, 0); + if (verbose > 3) output_flist(dir_list, "delete");