diff options
-rw-r--r-- | lib/Term/Cap.pm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Term/Cap.pm b/lib/Term/Cap.pm index 0e34d7a3da..8cf14c97c1 100644 --- a/lib/Term/Cap.pm +++ b/lib/Term/Cap.pm @@ -213,11 +213,15 @@ sub Tgetent { ## public -- static method $entry = $VMS_TERMCAP; } else { + if ( grep { -x "$_/infocmp" } split /:/, $ENV{PATH} ) { eval { - $entry = `infocmp -C 2>/dev/null` - if grep { -x "$_/infocmp" } split /:/, $ENV{PATH}; + $foo = `infocmp -C 2>/dev/null`; + if (($foo !~ m:^/:s) && ($foo =~ m/(^|\|)${termpat}[:|]/s)) { + $entry = $foo; + } } + } } } |