From 460dc4855edf8f043d3085ea8779149b8a7ecfb1 Mon Sep 17 00:00:00 2001 From: espie Date: Mon, 6 Nov 2023 08:14:36 +0000 Subject: [PATCH] simplify logic for $entry in the main termcap loop --- gnu/usr.bin/perl/cpan/Term-Cap/Cap.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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; -- 2.20.1