- /* Acts on cur_flist->file's ndx'th item, whose name is fname. If a dir,
-@@ -1229,8 +1374,12 @@ static void recv_generator(char *fname,
- }
+@@ -1502,9 +1651,12 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+ }
+ else if (delete_during && f_out != -1 && !phase
+ && !(file->flags & FLAG_MISSING_DIR)) {
+- if (file->flags & FLAG_CONTENT_DIR)
+- delete_in_dir(fname, file, &real_sx.st.st_dev);
+- else
++ if (file->flags & FLAG_CONTENT_DIR) {
++ if (detect_renamed && real_ret != 0)
++ unexplored_dirs++;
++ delete_in_dir(fname, file, &real_sx.st.st_dev,
++ delete_during < 0 ? DEL_NO_DELETIONS : 0);
++ } else
+ change_local_filter_dir(fname, strlen(fname), F_DEPTH(file));
+ }
+ goto cleanup;
+@@ -1782,8 +1934,14 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+ goto cleanup;