]> sjero.net Git - wget/blobdiff - src/ftp.c
[svn] Make sure opt.dfp is rewound only on the first retrieval.
[wget] / src / ftp.c
index ae96df7032e73ce04c1a129a7bb1e0c0634bd235..0cdbcc1d18a1c5ef313fb10a77672b2802d4eeba 100644 (file)
--- a/src/ftp.c
+++ b/src/ftp.c
@@ -814,8 +814,13 @@ Error in server response, closing control connection.\n"));
     }
   else
     {
+      extern int global_download_count;
       fp = opt.dfp;
-      if (!restval)
+
+      /* Rewind the output document if the download starts over and if
+        this is the first download.  See gethttp() for a longer
+        explanation.  */
+      if (!restval && global_download_count == 0)
        {
          /* This will silently fail for streams that don't correspond
             to regular files, but that's OK.  */