From: Magnus Damm <damm@opensource.se>

This patch updates the shared progress meter code to only
print out percentage when the total size is known. Without
this patch the percentage is stuck at 100%.

Signed-off-by: Magnus Damm <damm@opensource.se>
---

 libbb/progress.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

--- 0003/libbb/progress.c
+++ work/libbb/progress.c	2009-09-30 21:41:15.000000000 +0900
@@ -33,14 +33,17 @@ void bb_progress_update(bb_progress_t *p
 	unsigned ratio;
 	int barlength, i;
 
-	ratio = 100;
+	/* print out percentage only when the total size is known */
 	if (totalsize) {
 		/* long long helps to have it working even if !LFS */
 		ratio = (unsigned) (100ULL * (transferred+beg_range) / totalsize);
 		if (ratio > 100) ratio = 100;
-	}
 
-	fprintf(stderr, "\r%-20.20s%4d%% ", curfile, ratio);
+		fprintf(stderr, "\r%-20.20s%4d%% ", curfile, ratio);
+	} else {
+		ratio = 0;
+		fprintf(stderr, "\r%-25.25s ", curfile);
+	}
 
 	barlength = get_tty2_width() - 49;
 	if (barlength > 0) {
