From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 8C7CF1FFB1 for ; Wed, 3 Feb 2021 08:11:44 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 04/11] lei: err: avoid uninitialized variable warnings Date: Tue, 2 Feb 2021 22:11:36 -1000 Message-Id: <20210203081143.24424-5-e@80x24.org> In-Reply-To: <20210203081143.24424-1-e@80x24.org> References: <20210203081143.24424-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: --- 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, @_) }