]> sjero.net Git - wget/blobdiff - src/main.c
[svn] Fix -O timestamp bug.
[wget] / src / main.c
index 1b85b0b35a9226bd72fe10a0ab987337312ddb1b..221ac5ae3d93824a0407d9112ca0c4f9053a8a24 100644 (file)
@@ -726,12 +726,15 @@ Can't timestamp and not clobber old files at the same time.\n"));
        opt.dfp = stdout;
       else
        {
+         struct stat st;
          opt.dfp = fopen (opt.output_document, "wb");
          if (opt.dfp == NULL)
            {
              perror (opt.output_document);
              exit (1);
            }
+         if (fstat (fileno (opt.dfp), &st) == 0 && S_ISREG (st.st_mode))
+           opt.od_known_regular = 1;
        }
     }