From: espie Date: Mon, 6 Nov 2023 08:14:36 +0000 (+0000) Subject: simplify logic for $entry in the main termcap loop X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=460dc4855edf8f043d3085ea8779149b8a7ecfb1;p=openbsd simplify logic for $entry in the main termcap loop --- diff --git a/gnu/usr.bin/perl/cpan/Term-Cap/Cap.pm b/gnu/usr.bin/perl/cpan/Term-Cap/Cap.pm index f6fb5660700..7608998d61a 100644 --- a/gnu/usr.bin/perl/cpan/Term-Cap/Cap.pm +++ b/gnu/usr.bin/perl/cpan/Term-Cap/Cap.pm @@ -332,11 +332,14 @@ sub Tgetent defined(my $x = <$fh>) or last; $_ .= $x; chomp; } + if (defined $entry) { + $entry .= $_; + } else { + $entry = $_; + } last; } } - defined $entry or $entry = ''; - $entry .= $_ if $_; close $fh; waitpid($child, 0) if defined $child;