From: espie Date: Mon, 6 Nov 2023 08:11:11 +0000 (+0000) Subject: simplify $ENV{TERMCAP} handling: don't bother setting anything if X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=962e816ab0bdb692bb446f3f7ffa7b271a1b5520;p=openbsd simplify $ENV{TERMCAP} handling: don't bother setting anything if the variable doesn't exist --- diff --git a/gnu/usr.bin/perl/cpan/Term-Cap/Cap.pm b/gnu/usr.bin/perl/cpan/Term-Cap/Cap.pm index 6ff37482ce5..5d3d296a17e 100644 --- a/gnu/usr.bin/perl/cpan/Term-Cap/Cap.pm +++ b/gnu/usr.bin/perl/cpan/Term-Cap/Cap.pm @@ -222,13 +222,12 @@ sub Tgetent $tmp_term = $self->{TERM}; my $seen = {}; - my $foo = ( exists $ENV{TERMCAP} ? $ENV{TERMCAP} : '' ); - - # $entry is the extracted termcap entry - if ( ( $foo !~ m:^/:s ) && ( $foo =~ m/(^|\|)\Q$tmp_term\E[:|]/s ) ) - { - $entry = $foo; - $seen->{$tmp_term} = 1; + if (exists $ENV{TERMCAP}) { + local $_ = $ENV{TERMCAP}; + if ( !m:^/:s && m/(^|\|)\Q$tmp_term\E[:|]/s ) { + $entry = $_; + $seen->{$tmp_term} = 1; + } } my @termcap_path = termcap_path();