]> sjero.net Git - wget/commitdiff
[svn] Don't calculate the ETA if nothing has yet been downloaded.
authorhniksic <devnull@localhost>
Thu, 27 Nov 2003 22:59:36 +0000 (14:59 -0800)
committerhniksic <devnull@localhost>
Thu, 27 Nov 2003 22:59:36 +0000 (14:59 -0800)
src/ChangeLog
src/progress.c

index a077cd68ae00e51c55cf29089263a55761f99c0e..c0ebba2d03c4b39009462cf9e6324e5597779862 100644 (file)
@@ -1,3 +1,8 @@
+2003-11-27  Hrvoje Niksic  <hniksic@xemacs.org>
+
+       * progress.c (create_image): Don't calculate ETA if nothing has
+       been downloaded yet, because it causes division by zero.
+
 2003-11-27  Hrvoje Niksic  <hniksic@xemacs.org>
 
        * connect.c (bind_local): Rename sa_len to addrlen because IRIX
index 3497bff20dae205b9c26fc71c6de1dacf1a03537..33ccb7c9c465e358fc691ca50ee9f5c7753ae6de 100644 (file)
@@ -850,7 +850,7 @@ create_image (struct bar_progress *bp, double dl_total_time)
   /* " ETA xx:xx:xx"; wait for three seconds before displaying the ETA.
      That's because the ETA value needs a while to become
      reliable.  */
-  if (bp->total_length > 0 && dl_total_time > 3000)
+  if (bp->total_length > 0 && bp->count > 0 && dl_total_time > 3000)
     {
       long eta;
       int eta_hrs, eta_min, eta_sec;