From: Brendan O'Dea Date: Fri, 25 May 2001 11:18:29 +0000 (+1000) Subject: 5.6.1 Term::Cap -- add terminfo fallback X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e66fb0c202c476a67c63915139a2545b39101339;p=p5sagit%2Fp5-mst-13.2.git 5.6.1 Term::Cap -- add terminfo fallback Message-ID: <20010525111829.A28411@compusol.com.au> (Slightly modified.) p4raw-id: //depot/perl@10208 --- diff --git a/lib/Term/Cap.pm b/lib/Term/Cap.pm index 70376a6..06002e2 100644 --- a/lib/Term/Cap.pm +++ b/lib/Term/Cap.pm @@ -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