PATCH: lib/Term/Cap.pm
Norton T. Allen [Wed, 2 Jan 2002 14:22:09 +0000 (09:22 -0500)]
   Message-Id: <200201021922.OAA18505@bottesini.harvard.edu>

p4raw-id: //depot/perl@14024

lib/Term/Cap.pm

index 0e34d7a..8cf14c9 100644 (file)
@@ -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;
+            }
            }
+         }
         }
     }