1. my class IO::Spec::QNX is IO::Spec::Unix {
  2. method canonpath ($patharg, :$parent) {
  3. my $path = $patharg.Str;
  4. # Handle POSIX-style node names beginning with double slash (qnx, nto)
  5. # (POSIX says: "a pathname that begins with two successive slashes
  6. # may be interpreted in an implementation-defined manner, although
  7. # more than two leading slashes shall be treated as a single slash.")
  8. my $node = '';
  9. if $path ~~ s {^ ( '//' <-[ / ]>+ ) '/'? $} = ''
  10. or $path ~~ s {^ ( '//' <-[ / ]>+ ) '/' } = '/'
  11. { $node = ~ $0; }
  12. $path = IO::Spec::Unix.canonpath($path, :$parent);
  13. $node ~ $path;
  14. }
  15. }