]> sjero.net Git - wget/blobdiff - src/http.c
[svn] Fix -O timestamp bug.
[wget] / src / http.c
index 24785b0be1972a76bfd1c1ace83aa65a631f8d32..676fef5b7db4a0845d5b7a75380e1aab58ede452 100644 (file)
@@ -364,7 +364,7 @@ register_persistent (const char *host, unsigned short port, int fd
 static int
 persistent_available_p (const char *host, unsigned short port
 #ifdef HAVE_SSL
-                       int ssl
+                       int ssl
 #endif
                        )
 {
@@ -1526,15 +1526,25 @@ The sizes do not match (local %ld) -- retrieving.\n"), local_size);
          FREEHSTAT (hstat);
          continue;
        }
-      if (!opt.dfp
-         && (tmr != (time_t) (-1))
+      if ((tmr != (time_t) (-1))
          && !opt.spider
          && ((hstat.len == hstat.contlen) ||
              ((hstat.res == 0) &&
               ((hstat.contlen == -1) ||
                (hstat.len >= hstat.contlen && !opt.kill_longer)))))
        {
-         touch (u->local, tmr);
+         /* #### 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, tmr);
        }
       /* End of time-stamping section.  */