5.6.1 Term::Cap -- add terminfo fallback
Brendan O'Dea [Fri, 25 May 2001 11:18:29 +0000 (21:18 +1000)]
Message-ID: <20010525111829.A28411@compusol.com.au>

(Slightly modified.)

p4raw-id: //depot/perl@10208

lib/Term/Cap.pm

index 70376a6..06002e2 100644 (file)
@@ -168,6 +168,14 @@ sub Tgetent { ## public -- static method
     }
 
     my @termcap_path = termcap_path;
+
+    unless (@termcap_path || $entry)
+    {
+       # last resort--fake up a termcap from terminfo 
+       local $ENV{TERM} = $term;
+       $entry = `infocmp -C 2>/dev/null`;
+    }
+
     croak "Can't find a valid termcap file" unless @termcap_path || $entry;
 
     $state = 1;                                        # 0 == finished