From: Norton T. Allen Date: Wed, 27 Jun 2001 10:33:05 +0000 (-0400) Subject: for QNX X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=89bb8afa765779f815d6d436b7f1e9db9b5c2327;p=p5sagit%2Fp5-mst-13.2.git for QNX Message-Id: <200106271433.KAA04947@bottesini.harvard.edu> p4raw-id: //depot/perl@10988 --- diff --git a/lib/ExtUtils/MM_Unix.pm b/lib/ExtUtils/MM_Unix.pm index 9701641..5e06b16 100644 --- a/lib/ExtUtils/MM_Unix.pm +++ b/lib/ExtUtils/MM_Unix.pm @@ -81,15 +81,17 @@ 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 eq 'qnx' && $path =~ s|^(//\d+)/|/|s ) { + if ( $^O =~ m/^qnx|nto$/ && $path =~ s:^(//[^/]+)(/|\z):/:s ) { $node = $1; } $path =~ s|(?<=[^/])/+|/|g ; # xx////xx -> xx/xx $path =~ s|(/\.)+/|/|g ; # xx/././xx -> xx/xx $path =~ s|^(\./)+||s unless $path eq "./"; # ./xx -> xx $path =~ s|(?<=[^/])/\z|| ; # xx/ -> xx - "$node$path"; + return "$node$path"; } =item catdir diff --git a/lib/File/Spec/Unix.pm b/lib/File/Spec/Unix.pm index 4e4cc75..bd4d77b 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