return $output;
}
-# Brackets are valid in VMS filespecs and this test puts filespecs
-# into regexes a lot.
-
-sub _escape_brackets {
- my $str = shift;
- $str =~ s/\[/\\\[/g;
- $str =~ s/\]/\\\]/g;
- return $str;
-}
-
my $i = 0;
my $dir = File::Spec->catdir($incdir, 'auto');
if ($^O eq 'VMS') {
while ($output =~ m/(\[.+\])/) {
$filespec = $1;
$replacement = VMS::Filespec::unixify($filespec);
- $filespec = _escape_brackets($filespec);
$replacement =~ s/\/$//;
- $output =~ s/$filespec/$replacement/;
+ $output =~ s/\Q$filespec\E/$replacement/;
}
}
if ($args{Tests}) {
foreach my $code (split /\n/, $args{Tests}) {
next if $code =~ /^\#/;
- $code =~ s/\[(File::Spec->catfile\(.*\))\]/[_escape_brackets($1)]/ if $^O eq 'VMS';
defined eval $code or fail(), print "# Code: $code\n# Error: $@";
}
}