| 1 | package URI::file::OS2; | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use warnings; | ||
| 5 | |||
| 6 | use parent 'URI::file::Win32'; | ||
| 7 | |||
| 8 | our $VERSION = '5.40'; | ||
| 9 | |||
| 10 | # The Win32 version translates k:/foo to file://k:/foo (?!) | ||
| 11 | # We add an empty host | ||
| 12 | |||
| 13 | sub _file_extract_authority { | ||
| 14 | shift; # $class | ||
| 15 | return $1 if $_[0] =~ s,^\\\\([^\\]+),,; # UNC | ||
| 16 | return $1 if $_[0] =~ s,^//([^/]+),,; # UNC too? | ||
| 17 | |||
| 18 | if ($_[0] =~ m#^[a-zA-Z]{1,2}:#) { # allow for ab: drives | ||
| 19 | return ""; | ||
| 20 | } | ||
| 21 | return; | ||
| 22 | } | ||
| 23 | |||
| 24 | sub file { | ||
| 25 | my $p = &URI::file::Win32::file; | ||
| 26 | return unless defined $p; | ||
| 27 | $p =~ s,\\,/,g; | ||
| 28 | $p; | ||
| 29 | } | ||
| 30 | |||
| 31 | 1; |