From ffe17a8197e73b791f6b1609bdcdc3a40818acdc Mon Sep 17 00:00:00 2001
From: Daniel Stenberg <daniel@haxx.se>
Date: Fri, 26 Nov 2004 14:33:13 +0000
Subject: [PATCH] As reported in Mandrake's bug tracker bug 12289
 (http://qa.mandrakesoft.com/show_bug.cgi?id=12289), curl would print a
 newline to "finish" the progress meter after each redirect and not only after
 a completed transfer.

---
 CHANGES        | 6 ++++++
 lib/progress.c | 6 ++----
 lib/transfer.c | 5 +++++
 3 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/CHANGES b/CHANGES
index 93e77c7a35..fcec5e2a8b 100644
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,12 @@
 
                                   Changelog
 
+Daniel (26 November 2004)
+- As reported in Mandrake's bug tracker bug 12289
+  (http://qa.mandrakesoft.com/show_bug.cgi?id=12289), curl would print a
+  newline to "finish" the progress meter after each redirect and not only
+  after a completed transfer.
+
 Daniel (25 November 2004)
 - FTP improvements:
 
diff --git a/lib/progress.c b/lib/progress.c
index 55f316acc3..ce1adb805b 100644
--- a/lib/progress.c
+++ b/lib/progress.c
@@ -139,10 +139,8 @@ void Curl_pgrsDone(struct connectdata *conn)
   struct SessionHandle *data = conn->data;
   data->progress.lastshow=0;
   Curl_pgrsUpdate(conn); /* the final (forced) update */
-  if(!(data->progress.flags & PGRS_HIDE) &&
-     !data->progress.callback)
-    /* only output if we don't use a progress callback and we're not hidden */
-    fprintf(data->set.err, "\n");
+
+  data->progress.speeder_c = 0; /* reset the progress meter display */
 }
 
 /* reset all times except redirect */
diff --git a/lib/transfer.c b/lib/transfer.c
index 5e83335385..017784552b 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -1657,6 +1657,11 @@ CURLcode Curl_posttransfer(struct SessionHandle *data)
   (void)data; /* unused parameter */
 #endif
 
+  if(!(data->progress.flags & PGRS_HIDE) &&
+     !data->progress.callback)
+    /* only output if we don't use a progress callback and we're not hidden */
+    fprintf(data->set.err, "\n");
+
   return CURLE_OK;
 }
 
-- 
GitLab