VMS-specific symlink tweak for stat.t
authorCraig A. Berry <craigberry@mac.com>
Fri, 20 Jan 2012 23:19:43 +0000 (17:19 -0600)
committerCraig A. Berry <craigberry@mac.com>
Sat, 21 Jan 2012 03:42:21 +0000 (21:42 -0600)
If the target of a symlink has a version number in the symlink,
that makes the symlink implementation unable to locate it, so
trim off the version.

t/op/stat.t

index df31a38..1fa0d2f 100644 (file)
@@ -479,7 +479,9 @@ SKIP: {
     # bug id 20020124.004
     # If we have d_lstat, we should have symlink()
     my $linkname = 'stat-' . rand =~ y/.//dr;
-    symlink $Perl, $linkname or die "# Can't symlink $0: $!";
+    my $target = $Perl;
+    $target =~ s/;\d+\z// if $Is_VMS; # symlinks don't like version numbers
+    symlink $target, $linkname or die "# Can't symlink $0: $!";
     lstat $linkname;
     -T _;
     eval { lstat _ };