summaryrefslogtreecommitdiff
path: root/lib/Term
diff options
context:
space:
mode:
authorBrendan O'Dea <bod@debian.org>2001-05-25 21:18:29 +1000
committerJarkko Hietaniemi <jhi@iki.fi>2001-05-25 01:37:03 +0000
commite66fb0c202c476a67c63915139a2545b39101339 (patch)
tree697b1370f66d56f3aac1d8589dc99c86608e91bc /lib/Term
parent97b9a4cba4a5c4e26cd7e473ffd825348d541a87 (diff)
downloadperl-e66fb0c202c476a67c63915139a2545b39101339.tar.gz
5.6.1 Term::Cap -- add terminfo fallback
Message-ID: <20010525111829.A28411@compusol.com.au> (Slightly modified.) p4raw-id: //depot/perl@10208
Diffstat (limited to 'lib/Term')
-rw-r--r--lib/Term/Cap.pm8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Term/Cap.pm b/lib/Term/Cap.pm
index 70376a65dd..06002e2f7a 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