File ht-search-progress.diff of Package ht

From: Jan Engelhardt <jengelh@medozas.de>
Date: 2008?

Knowing how far a search has progressed (and as such estimating on how
long it can take) is tremendously useful.
---
 htsearch.cc |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Index: ht-2.0.17/htsearch.cc
===================================================================
--- ht-2.0.17.orig/htsearch.cc
+++ ht-2.0.17/htsearch.cc
@@ -531,10 +531,11 @@ bool search_bin_process(Object *context,
 	}
 	ctx->o -= ctx->patlen-1;
 
-	int p = (int)(((double)(ctx->o - ctx->ofs))*100/ctx->len);
+	double p = ((double)(ctx->o - ctx->ofs))*100/ctx->len;
 
 	char status[64];
-	ht_snprintf(status, sizeof status, "%d %%", p);
+	ht_snprintf(status, sizeof status, "%.1f %% (%llu MB)",
+		p, (unsigned long long)ctx->o >> 20);
 	progress_indicator->settext(status);
 
 	return true;
openSUSE Build Service is sponsored by