diff options
author | Norton T. Allen <allen@huarp.harvard.edu> | 2001-06-27 06:33:05 -0400 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-06-27 13:33:32 +0000 |
commit | 89bb8afa765779f815d6d436b7f1e9db9b5c2327 (patch) | |
tree | 43dd61f47021f6883293fcd85a6727cf1ac0e8f3 /lib/File | |
parent | 6c750130ce8dd62751f1a9c6334f446fe8af2f73 (diff) | |
download | perl-89bb8afa765779f815d6d436b7f1e9db9b5c2327.tar.gz |
for QNX
Message-Id: <200106271433.KAA04947@bottesini.harvard.edu>
p4raw-id: //depot/perl@10988
Diffstat (limited to 'lib/File')
-rw-r--r-- | lib/File/Spec/Unix.pm | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/File/Spec/Unix.pm b/lib/File/Spec/Unix.pm index 4e4cc753aa..bd4d77b7cd 100644 --- a/lib/File/Spec/Unix.pm +++ b/lib/File/Spec/Unix.pm @@ -34,12 +34,18 @@ path. On UNIX eliminated successive slashes and successive "/.". sub canonpath { my ($self,$path) = @_; + + # Handle POSIX-style node names beginning with double slash + my $node = ''; + if ( $^O =~ m/^qnx|nto$/ && $path =~ s:^(//[^/]+)(/|\z):/:s ) { + $node = $1; + } $path =~ s|/+|/|g unless($^O eq 'cygwin'); # xx////xx -> xx/xx $path =~ s|(/\.)+/|/|g; # xx/././xx -> xx/xx $path =~ s|^(\./)+||s unless $path eq "./"; # ./xx -> xx $path =~ s|^/(\.\./)+|/|s; # /../../xx -> xx $path =~ s|/\Z(?!\n)|| unless $path eq "/"; # xx/ -> xx - return $path; + return "$node$path"; } =item catdir |