perl 5.003_04: lib/Test/Harness.pm
[p5sagit/p5-mst-13.2.git] / lib / termcap.pl
index aa221df..e8f108d 100644 (file)
@@ -1,4 +1,4 @@
-;# $RCSfile: termcap.pl,v $$Revision: 4.0.1.1 $$Date: 92/06/08 13:49:17 $
+;# $RCSfile: termcap.pl,v $$Revision: 4.1 $$Date: 92/08/07 18:24:16 $
 ;#
 ;# Usage:
 ;#     require 'ioctl.pl';
@@ -18,6 +18,7 @@ sub Tgetent {
        delete $TC{$key};
     }
     $TERM = $ENV{'TERM'} unless $TERM;
+    $TERM =~ s/(\W)/\\$1/g;
     $TERMCAP = $ENV{'TERMCAP'};
     $TERMCAP = '/etc/termcap' unless $TERMCAP;
     if ($TERMCAP !~ m:^/:) {
@@ -33,7 +34,7 @@ sub Tgetent {
            while (<TERMCAP>) {
                next if /^#/;
                next if /^\t/;
-               if (/(^|\\|)$TERM[:\\|]/) {
+               if (/(^|\\|)${TERM}[:\\|]/) {
                    chop;
                    while (chop eq '\\\\') {
                        \$_ .= <TERMCAP>;