aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2021-03-25 11:52:16 +0200
committerSergey Poznyakoff <gray@gnu.org>2021-03-25 11:52:16 +0200
commit80ca225db505070c6ec24a986618c676963755f6 (patch)
treee8ee747da90e525b2fd4bc4249016369b0cd8484
parent2c67059dbc50d136b2680150ed53b67e88208dd0 (diff)
downloadglacier-master.tar.gz
glacier-master.tar.bz2
BugfixesHEADmaster
* lib/App/Glacier/DB.pm: Use allow_nonref to encode to JSON. * lib/App/Glacier/Progress.pm (display): Ignore non-positive padding.
-rw-r--r--lib/App/Glacier/DB.pm2
-rw-r--r--lib/App/Glacier/Progress.pm7
2 files changed, 6 insertions, 3 deletions
diff --git a/lib/App/Glacier/DB.pm b/lib/App/Glacier/DB.pm
index 74ad665..ad165f0 100644
--- a/lib/App/Glacier/DB.pm
+++ b/lib/App/Glacier/DB.pm
@@ -22,3 +22,3 @@ my %transcode = (
# Encoder
- sub { JSON->new->convert_blessed(1)->encode(shift) },
+ sub { JSON->new->allow_nonref->convert_blessed(1)->encode(shift) },
# Decoder
diff --git a/lib/App/Glacier/Progress.pm b/lib/App/Glacier/Progress.pm
index 39b892b..8defc7d 100644
--- a/lib/App/Glacier/Progress.pm
+++ b/lib/App/Glacier/Progress.pm
@@ -121,4 +121,7 @@ sub display {
}
-
- $text .= ' ' x ($self->_getwidth - length($text));
+
+ my $pad = $self->_getwidth - length($text);
+ if ($pad > 0) {
+ $text .= ' ' x $pad;
+ }
my $fd = $self->{_tty};

Return to:

Send suggestions and report system problems to the System administrator.