This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl 5.0 alpha 5
[perl5.git] / lib / termcap.pl
index d648526..22c1817 100644 (file)
@@ -1,4 +1,4 @@
-;# $Header: termcap.pl,v 3.0.1.3 90/08/09 04:02:53 lwall Locked $
+;# $RCSfile: termcap.pl,v $$Revision: 4.1 $$Date: 92/08/07 18:24:16 $
 ;#
 ;# Usage:
 ;#     require 'ioctl.pl';
@@ -21,7 +21,7 @@ sub Tgetent {
     $TERMCAP = $ENV{'TERMCAP'};
     $TERMCAP = '/etc/termcap' unless $TERMCAP;
     if ($TERMCAP !~ m:^/:) {
-       if (index($TERMCAP,"|$TERM|") < $[) {
+       if ($TERMCAP !~ /(^|\|)$TERM[:\|]/) {
            $TERMCAP = '/etc/termcap';
        }
     }
@@ -33,7 +33,7 @@ sub Tgetent {
            while (<TERMCAP>) {
                next if /^#/;
                next if /^\t/;
-               if (/\\|$TERM[:\\|]/) {
+               if (/(^|\\|)$TERM\[:\\|]/) {
                    chop;
                    while (chop eq '\\\\') {
                        \$_ .= <TERMCAP>;