X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FTerm%2FCap.pm;h=0954000e8d947c9097e4680d354418e300ee7f51;hb=206483f1ebeef33f7da74d5c167b3fd37bbf2d6b;hp=388f0edcb43f683dd3629b6f30ee542be9d865a5;hpb=6fb2d361298c4eb5d42f1f63b0f74a60d407e546;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/Term/Cap.pm b/lib/Term/Cap.pm index 388f0ed..0954000 100644 --- a/lib/Term/Cap.pm +++ b/lib/Term/Cap.pm @@ -104,10 +104,11 @@ as C<$self-E{TERMCAP}>. sub termcap_path { ## private my @termcap_path; # $TERMCAP, if it's a filespec - push(@termcap_path, $ENV{TERMCAP}) if ((exists $ENV{TERMCAP}) && - ($ENV{TERMCAP} =~ /^\// - or $^O eq 'os2' and - $ENV{TERMCAP} =~ /^[a-z]:\//i)); + push(@termcap_path, $ENV{TERMCAP}) + if ((exists $ENV{TERMCAP}) && + (($^O eq 'os2' || $^O eq 'MSWin32' || $^O eq 'dos') + ? $ENV{TERMCAP} =~ /^[a-z]:[\\\/]/is + : $ENV{TERMCAP} =~ /^\//s)); if ((exists $ENV{TERMPATH}) && ($ENV{TERMPATH})) { # Add the users $TERMPATH push(@termcap_path, split(/(:|\s+)/, $ENV{TERMPATH})) @@ -156,7 +157,7 @@ sub Tgetent { ## public -- static method my $foo = (exists $ENV{TERMCAP} ? $ENV{TERMCAP} : ''); # $entry is the extracted termcap entry - if (($foo !~ m:^/:) && ($foo =~ m/(^|\|)${termpat}[:|]/)) { + if (($foo !~ m:^/:s) && ($foo =~ m/(^|\|)${termpat}[:|]/s)) { $entry = $foo; }