]> sjero.net Git - wget/blobdiff - src/ftp.c
[svn] Fix -O timestamp bug.
[wget] / src / ftp.c
index bb0771cf6fcb62dca74fb312f6f03eefaaedbf30..2b9eb0f267e4b63a60db95ae19e7afe35990aebe 100644 (file)
--- a/src/ftp.c
+++ b/src/ftp.c
@@ -1370,8 +1370,18 @@ Already have correct symlink %s -> %s\n\n"),
           && dlthis
          && file_exists_p (u->local))
        {
-         const char *fl = opt.output_document ? opt.output_document : u->local;
-         touch (fl, f->tstamp);
+         /* #### This code repeats in http.c and ftp.c.  Move it to a
+             function!  */
+         const char *fl = NULL;
+         if (opt.output_document)
+           {
+             if (opt.od_known_regular)
+               fl = opt.output_document;
+           }
+         else
+           fl = u->local;
+         if (fl)
+           touch (fl, f->tstamp);
        }
       else if (f->tstamp == -1)
        logprintf (LOG_NOTQUIET, _("%s: corrupt time-stamp.\n"), u->local);