From ae706ae3a9094fe63f63cd8ec53f2b64e191182c Mon Sep 17 00:00:00 2001
From: Julien Chaffraix <julien.chaffraix@gmail.com>
Date: Sun, 20 Mar 2011 18:00:29 -0700
Subject: [PATCH] progress: don't print the last update on a separate line.

Curl_posttransfer is called to soon to add the final new line.
Moved the new line logic to pgrsDone as there is no more call to
update the progress status after it.

Reporter: Dmitri Shubin <sbn_at_tbricks.com>
http://curl.haxx.se/mail/lib-2010-12/0162.html
---
 lib/progress.c |    6 ++++++
 lib/transfer.c |    5 -----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/lib/progress.c b/lib/progress.c
index e0758f2..49047f1 100644
--- a/lib/progress.c
+++ b/lib/progress.c
@@ -137,6 +137,12 @@ void Curl_pgrsDone(struct connectdata *conn)
   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 */
 }
 
diff --git a/lib/transfer.c b/lib/transfer.c
index c33cf13..8d2c617 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -1528,11 +1528,6 @@ 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;
 }
 
-- 
1.7.1

