From: Jonathan Stowe <gellyfish@gellyfish.com>
Date: Mon, 3 Dec 2001 15:48:38 +0000 (+0000)
Subject: was Re: [PATCH] Shared hash keys
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7cae2445f8ea3c3758a465c9737cde17e55be1a6;p=p5sagit%2Fp5-mst-13.2.git

was Re: [PATCH] Shared hash keys
Message-ID: <Pine.LNX.4.33.0112031543290.386-100000@orpheus.gellyfish.com>

p4raw-id: //depot/perl@13441
---

diff --git a/lib/Term/Cap.pm b/lib/Term/Cap.pm
index 69a2f5e..a44601a 100644
--- a/lib/Term/Cap.pm
+++ b/lib/Term/Cap.pm
@@ -1,10 +1,12 @@
 package Term::Cap;
 
 use Carp;
+use strict;
 
 use vars qw($VERSION);
+use vars qw($termpat $state $first $entry);
 
-$VERSION = '1.03';
+$VERSION = '1.05';
 
 # Version undef: Thu Dec 14 20:02:42 CST 1995 by sanders@bsdi.com
 # Version 1.00:  Thu Nov 30 23:34:29 EST 2000 by schwern@pobox.com
@@ -19,6 +21,9 @@ $VERSION = '1.03';
 #       VMS Support from Charles Lane <lane@DUPHY4.Physics.Drexel.Edu>
 # Version 1.04:  Thu Nov 29 16:22:03 GMT 2001
 #       Fixed warnings in test
+# Version 1.05:  Mon Dec  3 15:33:49 GMT 2001
+#       Don't try to fall back on infocmp if it's not there. From chromatic.
+#
 
 # TODO:
 # support Berkeley DB termcaps
@@ -189,17 +194,17 @@ sub Tgetent { ## public -- static method
 	# last resort--fake up a termcap from terminfo 
 	local $ENV{TERM} = $term;
 
-         if ( $^O eq 'VMS' ) {
-	     chomp(my @entry = <DATA>);
-	     $entry = join '', @entry;
-         }
-         else {
-	     eval
-	     {
-		 $entry = `infocmp -C 2>/dev/null`;
-	     }
-	 }
-
+        if ( $^O eq 'VMS' ) {
+          chomp(my @entry = <DATA>);
+          $entry = join '', @entry;
+        }
+        else {
+           eval
+           {
+	     $entry = `infocmp -C 2>/dev/null`
+                    if grep { -x "$_/infocmp" } split /:/, $ENV{PATH};
+           }
+        }
     }
 
     croak "Can't find a valid termcap file" unless @termcap_path || $entry;