summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrendan O'Dea <bod@debian.org>2002-08-30 08:46:47 +1000
committerhv <hv@crypt.org>2002-08-30 13:10:45 +0000
commit9f4e9ad71dc4bd0e424987ff5dbb9bf517247227 (patch)
treee5138d4670f4b2b4873ddbbe8762b72a64adaddb
parent2e2b85db5c320075c6df5b304492078465626441 (diff)
downloadperl-9f4e9ad71dc4bd0e424987ff5dbb9bf517247227.tar.gz
Term::Cap allow # comments in infcocmp output
From: "Brendan O'Dea" <bod@debian.org> Message-ID: <20020829124647.GA1498@londo.odea.dropbear.id.au> p4raw-id: //depot/perl@17816
-rw-r--r--lib/Term/Cap.pm8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Term/Cap.pm b/lib/Term/Cap.pm
index 03d2573d85..1deadc5504 100644
--- a/lib/Term/Cap.pm
+++ b/lib/Term/Cap.pm
@@ -6,7 +6,7 @@ use strict;
use vars qw($VERSION $VMS_TERMCAP);
use vars qw($termpat $state $first $entry);
-$VERSION = '1.07';
+$VERSION = '1.08';
# 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
@@ -29,6 +29,8 @@ $VERSION = '1.07';
# Version 1.07: Wed Jan 2 21:35:09 GMT 2002
# Sanity check on infocmp output from Norton Allen
# Repaired INSTALLDIRS thanks to Michael Schwern
+# Version 1.08: Fri Aug 30 14:15:55 CEST 2002
+# Cope with comments lines from 'infocmp' from Brendan O'Dea
# TODO:
# support Berkeley DB termcaps
@@ -217,9 +219,9 @@ sub Tgetent { ## public -- static method
}
else {
if ( grep { -x "$_/infocmp" } split /:/, $ENV{PATH} ) {
- eval
- {
+ eval {
my $tmp = `infocmp -C 2>/dev/null`;
+ $tmp =~ s/^#.*\n//gm; # remove comments
if (( $tmp !~ m%^/%s ) && ( $tmp =~ /(^|\|)${termpat}[:|]/s)) {
$entry = $tmp;