]> sjero.net Git - wget/blobdiff - src/http.c
[svn] Fix -O timestamp bug.
[wget] / src / http.c
index 6e103d968f45a0dd0f194010f778d62bd9a854c6..676fef5b7db4a0845d5b7a75380e1aab58ede452 100644 (file)
@@ -1533,8 +1533,18 @@ The sizes do not match (local %ld) -- retrieving.\n"), local_size);
               ((hstat.contlen == -1) ||
                (hstat.len >= hstat.contlen && !opt.kill_longer)))))
        {
-         const char *fl = opt.output_document ? opt.output_document : u->local;
-         touch (fl, 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.  */