do not trim valueless contents v1.04
authorMischa POSLAWSKY <perl@shiar.org>
Sat, 7 Sep 2019 18:49:39 +0000 (20:49 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Sun, 8 Sep 2019 13:57:09 +0000 (15:57 +0200)
barcat

diff --git a/barcat b/barcat
index 600f453ffd3fad89a5ea764eada0338f745c7db4..1347cf5a5d053e282c721d6ee2669419180643a5 100755 (executable)
--- a/barcat
+++ b/barcat
@@ -85,7 +85,7 @@ while (readline) {
        s/^\h*// unless $opt{unmodified};
        push @values, s/$valmatch/\n/ && $1;
        push @order, $1 if length $1;
-       if (defined $opt{trim}) {
+       if (defined $opt{trim} and defined $1) {
                my $trimpos = abs $opt{trim};
                if ($trimpos <= 1) {
                        $_ = substr $_, 0, 1;