diff --git a/flist.c b/flist.c
--- a/flist.c
+++ b/flist.c
-@@ -122,6 +122,7 @@ static char empty_sum[MAX_DIGEST_LEN];
+@@ -121,6 +121,7 @@ static char tmp_sum[MAX_DIGEST_LEN];
+ static char empty_sum[MAX_DIGEST_LEN];
static int flist_count_offset; /* for --delete --progress */
static int dir_count = 0;
- static int high_hlink_ndx;
+static struct file_list *checksum_flist = NULL;
- static void clean_flist(struct file_list *flist, int strip_root);
+ static void flist_sort_and_clean(struct file_list *flist, int strip_root);
static void output_flist(struct file_list *flist);
-@@ -314,6 +315,186 @@ static void flist_done_allocating(struct file_list *flist)
+@@ -313,6 +314,186 @@ static void flist_done_allocating(struct file_list *flist)
flist->pool_boundary = ptr;
}
int push_pathname(const char *dir, int len)
{
if (dir == pathname)
-@@ -1005,7 +1186,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1003,7 +1184,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
STRUCT_STAT *stp, int flags, int filter_level)
{
static char *lastdir;
struct file_struct *file;
char thisname[MAXPATHLEN];
char linkname[MAXPATHLEN];
-@@ -1133,9 +1314,16 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1130,9 +1311,16 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
memcpy(lastdir, thisname, len);
lastdir[len] = '\0';
lastdir_len = len;
basename_len = strlen(basename) + 1; /* count the '\0' */
#ifdef SUPPORT_LINKS
-@@ -1211,11 +1399,21 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1208,11 +1396,21 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
}
#endif
/* This code is only used by the receiver when it is building
* a list of files for a delete pass. */
if (keep_dirlinks && linkname_len && flist) {
-@@ -2079,7 +2277,11 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
+@@ -2063,7 +2261,11 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
* file-list to check if this is a 1-file xfer. */
send_extra_file_list(f, 1);
}