diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2021-03-25 11:52:16 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2021-03-25 11:52:16 +0200 |
commit | 80ca225db505070c6ec24a986618c676963755f6 (patch) | |
tree | e8ee747da90e525b2fd4bc4249016369b0cd8484 | |
parent | 2c67059dbc50d136b2680150ed53b67e88208dd0 (diff) | |
download | glacier-master.tar.gz glacier-master.tar.bz2 |
* 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.pm | 2 | ||||
-rw-r--r-- | lib/App/Glacier/Progress.pm | 7 |
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}; |