-@@ -420,8 +420,10 @@ static void recv_generator(char *fname,
- statret = link_stat(fnamecmpbuf, &st, 0);
- if (!S_ISREG(st.st_mode))
- statret = -1;
-- if (statret == -1)
-+ if (statret == -1) {
- errno = saveerrno;
-+ *fnamecmpbuf = '\0';
-+ }
- #if HAVE_LINK
- else if (link_dest && !dry_run) {
- if (do_link(fnamecmpbuf, fname) != 0) {
-@@ -429,22 +431,22 @@ static void recv_generator(char *fname,
- rsyserr(FINFO, errno, "link %s => %s",
- fnamecmpbuf, fname);
- }
-- }
-- fnamecmp = fnamecmpbuf;
-+ fnamecmp = fnamecmpbuf;
-+ } else
-+ *fnamecmpbuf = '\0';
- }
+@@ -437,13 +437,16 @@ static void recv_generator(char *fname,
+ safe_fname(fname));
+ }
+ fnamecmp = fnamecmpbuf;
+- }
++ } else
++ *fnamecmpbuf = '\0';
+ } else