[pacman-dev] [PATCH] paccache: escape . in trimming of diskspace string

Dave Reisner d at falconindy.com
Sat Sep 10 22:47:42 EDT 2011


Before:
==> finished dry run: 2 candidates (diskspace saved: 7. MiB)

After:
==> finished dry run: 2 candidates (diskspace saved: 7.8 MiB)

Signed-off-by: Dave Reisner <dreisner at archlinux.org>
---
 contrib/paccache.in |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/contrib/paccache.in b/contrib/paccache.in
index b191ed9..8a8cad4 100755
--- a/contrib/paccache.in
+++ b/contrib/paccache.in
@@ -121,7 +121,7 @@ size_to_human() {
 		}
 
 		sizestr = sprintf("%.2f", size)
-		sub(/.?0+$/, "", sizestr)
+		sub(/\.?0+$/, "", sizestr)
 		printf("%s %s", sizestr, suffix[count])
 	}'
 }
-- 
1.7.6.1



More information about the pacman-dev mailing list