From c7420334c0d69bf948ad670c822753334e4664a8 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 2 Feb 2021 22:11:36 -1000 Subject: [PATCH] lei: err: avoid uninitialized variable warnings --- lib/PublicInbox/LEI.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm index 9afc90cf..9b4d4e0b 100644 --- a/lib/PublicInbox/LEI.pm +++ b/lib/PublicInbox/LEI.pm @@ -308,12 +308,12 @@ sub x_it ($$) { sub err ($;@) { my $self = shift; my $err = $self->{2} // ($self->{pgr} // [])->[2] // *STDERR{GLOB}; - my $eor = (substr($_[-1], -1, 1) eq "\n" ? () : "\n"); - print $err @_, $eor and return; + my @eor = (substr($_[-1]//'', -1, 1) eq "\n" ? () : ("\n")); + print $err @_, @eor and return; my $old_err = delete $self->{2}; - close($old_err) if $! == EPIPE && $old_err;; + close($old_err) if $! == EPIPE && $old_err; $err = $self->{2} = ($self->{pgr} // [])->[2] // *STDERR{GLOB}; - print $err @_, $eor or print STDERR @_, $eor; + print $err @_, @eor or print STDERR @_, @eor; } sub qerr ($;@) { $_[0]->{opt}->{quiet} or err(shift, @_) } -- 2.44.0