]> sjero.net Git - wget/blobdiff - src/progress.c
[svn] Fixes by Christian Biere:
[wget] / src / progress.c
index 3497bff20dae205b9c26fc71c6de1dacf1a03537..3fae615dcae86f0d8ba2d2af28941c97cf3bbc5b 100644 (file)
@@ -50,7 +50,7 @@ so, delete this exception statement from your version.  */
 #include "retr.h"
 
 struct progress_implementation {
-  char *name;
+  const char *name;
   int interactive;
   void *(*create) PARAMS ((long, long));
   void (*update) PARAMS ((void *, long, double));
@@ -834,7 +834,7 @@ create_image (struct bar_progress *bp, double dl_total_time)
   /* " 1012.45K/s" */
   if (hist->total_time && hist->total_bytes)
     {
-      static char *short_units[] = { "B/s", "K/s", "M/s", "G/s" };
+      static const char *short_units[] = { "B/s", "K/s", "M/s", "G/s" };
       int units = 0;
       /* Calculate the download speed using the history ring and
         recent data that hasn't made it to the ring yet.  */
@@ -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;
@@ -939,8 +939,6 @@ bar_set_params (const char *params)
          TTY -- when logging to file, it is better to review the
          dots.  */
        || !isatty (fileno (stderr))
-#else
-       1
 #endif
        /* Normally we don't depend on terminal type because the
          progress bar only uses ^M to move the cursor to the