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}))
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;
}