static char empty_sum[MAX_DIGEST_LEN];
static int flist_count_offset; /* for --delete --progress */
static int dir_count = 0;
-@@ -262,6 +265,45 @@ static int is_excluded(char *fname, int is_dir, int filter_level)
+@@ -261,6 +264,45 @@ static int is_excluded(char *fname, int is_dir, int filter_level)
return 0;
}
static void send_directory(int f, struct file_list *flist,
char *fbuf, int len, int flags);
-@@ -2183,6 +2225,25 @@ struct file_list *recv_file_list(int f)
+@@ -2167,6 +2209,25 @@ struct file_list *recv_file_list(int f)
- clean_flist(flist, relative_paths);
+ flist_sort_and_clean(flist, relative_paths);
+ if (detect_renamed) {
+ int j = flist->used;
if (do_progress && !am_server)
rprintf(FINFO, " \r");
-@@ -1139,6 +1290,7 @@ static void list_file_entry(struct file_struct *f)
+@@ -1137,6 +1288,7 @@ static void list_file_entry(struct file_struct *f)
}
}
static int phase = 0;
static int dflt_perms;
-@@ -1383,8 +1535,12 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1381,8 +1533,12 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
}
}
else if (delete_during && f_out != -1 && !phase && dry_run < 2
goto cleanup;
}
-@@ -1662,8 +1818,14 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1660,8 +1816,14 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
goto cleanup;
}
#endif
rsyserr(FERROR_XFER, stat_errno, "recv_generator: failed to stat %s",
full_fname(fname));
goto cleanup;
-@@ -2000,6 +2162,12 @@ void generate_files(int f_out, const char *local_name)
+@@ -2004,6 +2166,12 @@ void generate_files(int f_out, const char *local_name)
if (verbose > 2)
rprintf(FINFO, "generator starting pid=%ld\n", (long)getpid());
if (delete_before && !solo_file && cur_flist->used > 0)
do_delete_pass();
if (delete_during == 2) {
-@@ -2010,7 +2178,7 @@ void generate_files(int f_out, const char *local_name)
+@@ -2014,7 +2182,7 @@ void generate_files(int f_out, const char *local_name)
}
do_progress = 0;
whole_file = 0;
if (verbose >= 2) {
rprintf(FINFO, "delta-transmission %s\n",
-@@ -2048,7 +2216,7 @@ void generate_files(int f_out, const char *local_name)
+@@ -2052,7 +2220,7 @@ void generate_files(int f_out, const char *local_name)
dirdev = MAKEDEV(DEV_MAJOR(devp), DEV_MINOR(devp));
} else
dirdev = MAKEDEV(0, 0);
}
}
}
-@@ -2091,7 +2259,21 @@ void generate_files(int f_out, const char *local_name)
+@@ -2095,7 +2263,21 @@ void generate_files(int f_out, const char *local_name)
} while ((cur_flist = cur_flist->next) != NULL);
if (delete_during)
diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -80,6 +80,7 @@ int am_generator = 0;
+@@ -81,6 +81,7 @@ int am_generator = 0;
int am_starting_up = 1;
int relative_paths = -1;
int implied_dirs = 1;
int numeric_ids = 0;
int allow_8bit_chars = 0;
int force_delete = 0;
-@@ -385,6 +386,7 @@ void usage(enum logcode F)
+@@ -386,6 +387,7 @@ void usage(enum logcode F)
rprintf(F," --modify-window=NUM compare mod-times with reduced accuracy\n");
rprintf(F," -T, --temp-dir=DIR create temporary files in directory DIR\n");
rprintf(F," -y, --fuzzy find similar file for basis if no dest file\n");
rprintf(F," --compare-dest=DIR also compare destination files relative to DIR\n");
rprintf(F," --copy-dest=DIR ... and include copies of unchanged files\n");
rprintf(F," --link-dest=DIR hardlink to files in DIR when unchanged\n");
-@@ -563,6 +565,7 @@ static struct poptOption long_options[] = {
+@@ -564,6 +566,7 @@ static struct poptOption long_options[] = {
{"compare-dest", 0, POPT_ARG_STRING, 0, OPT_COMPARE_DEST, 0, 0 },
{"copy-dest", 0, POPT_ARG_STRING, 0, OPT_COPY_DEST, 0, 0 },
{"link-dest", 0, POPT_ARG_STRING, 0, OPT_LINK_DEST, 0, 0 },
{"fuzzy", 'y', POPT_ARG_NONE, &fuzzy_basis, 0, 0, 0 },
{"compress", 'z', POPT_ARG_NONE, 0, 'z', 0, 0 },
{"no-compress", 0, POPT_ARG_VAL, &do_compression, 0, 0, 0 },
-@@ -1535,7 +1538,7 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain)
+@@ -1541,7 +1544,7 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain)
inplace = 1;
}
partial_dir = tmp_partialdir;
if (inplace) {
-@@ -1544,6 +1547,7 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain)
+@@ -1550,6 +1553,7 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain)
snprintf(err_buf, sizeof err_buf,
"--%s cannot be used with --%s\n",
append_mode ? "append" : "inplace",
delay_updates ? "delay-updates" : "partial-dir");
return 0;
}
-@@ -1888,6 +1892,8 @@ void server_options(char **args, int *argc_p)
+@@ -1896,6 +1900,8 @@ void server_options(char **args, int *argc_p)
args[ac++] = "--super";
if (size_only)
args[ac++] = "--size-only";