diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2010-03-07 15:53:19 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2010-03-07 15:53:19 +0000 |
commit | 53d737f24f093c9156b2aca419b7ad63a09ef6c3 (patch) | |
tree | 00d52a1e255c07e38b46182d7d7bd00a824bf71e | |
parent | dc45e03033ee1bb5997879f28192da84ced604aa (diff) |
erase to the end of "previous line". Avoid dangling % after displaying 100%.
from sthen@.
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm b/usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm index 9743950badd..8711ca5835b 100644 --- a/usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm +++ b/usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: ProgressMeter.pm,v 1.28 2010/03/06 11:42:58 espie Exp $ +# $OpenBSD: ProgressMeter.pm,v 1.29 2010/03/07 15:53:18 espie Exp $ # # Copyright (c) 2004-2007 Marc Espie <espie@openbsd.org> # @@ -95,7 +95,11 @@ sub _show return if $d eq $lastdisplay && !$continued; $lastdisplay=$d; $continued = 0; - print $d, "\r"; + print $d; + if ($width > length($d)) { + print ' 'x($width - length($d) - 1); + } + print "\r"; } sub message |