simplify logic for $entry in the main termcap loop
authorespie <espie@openbsd.org>
Mon, 6 Nov 2023 08:14:36 +0000 (08:14 +0000)
committerespie <espie@openbsd.org>
Mon, 6 Nov 2023 08:14:36 +0000 (08:14 +0000)
gnu/usr.bin/perl/cpan/Term-Cap/Cap.pm

index f6fb566..7608998 100644 (file)
@@ -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;