diff options
author | Bernd Ahlers <bernd@cvs.openbsd.org> | 2006-02-10 09:52:29 +0000 |
---|---|---|
committer | Bernd Ahlers <bernd@cvs.openbsd.org> | 2006-02-10 09:52:29 +0000 |
commit | de5c3c1aa209937d67f3fddbb70d9cf898fad141 (patch) | |
tree | 3a9a1e73965a8d1d1b941be337ec884dd9b42f93 /usr.sbin/pkg_add/OpenBSD | |
parent | 32066657cbdad445e9be0db314edb39f18967cbc (diff) |
If the length of the message in OpenBSD::ProgressMeter::message() is shorter
than the length of the playfield, fill up the difference with whitespace.
Prevents leftover characters from previous message()s.
ok espie@
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm b/usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm index ead95698cdf..cbab757a947 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.7 2005/10/23 10:03:23 espie Exp $ +# $OpenBSD: ProgressMeter.pm,v 1.8 2006/02/10 09:52:28 bernd Exp $ # # Copyright (c) 2004 Marc Espie <espie@openbsd.org> # @@ -93,6 +93,9 @@ sub message return unless $isatty; my $message = shift; my $d; + if ($playfield > length($message)) { + $message .= ' 'x($playfield - length($message)); + } if ($playfield) { $d = "$header|".substr($message, 0, $playfield); } else { |