summaryrefslogtreecommitdiff
path: root/lib/URI/file/OS2.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/URI/file/OS2.pm')
-rw-r--r--lib/URI/file/OS2.pm32
1 files changed, 32 insertions, 0 deletions
diff --git a/lib/URI/file/OS2.pm b/lib/URI/file/OS2.pm
new file mode 100644
index 0000000..f451f9e
--- /dev/null
+++ b/lib/URI/file/OS2.pm
@@ -0,0 +1,32 @@
+package URI::file::OS2;
+
+use strict;
+use warnings;
+
+use parent 'URI::file::Win32';
+
+our $VERSION = "1.69";
+
+# The Win32 version translates k:/foo to file://k:/foo (?!)
+# We add an empty host
+
+sub _file_extract_authority
+{
+ my $class = shift;
+ return $1 if $_[0] =~ s,^\\\\([^\\]+),,; # UNC
+ return $1 if $_[0] =~ s,^//([^/]+),,; # UNC too?
+
+ if ($_[0] =~ m#^[a-zA-Z]{1,2}:#) { # allow for ab: drives
+ return "";
+ }
+ return;
+}
+
+sub file {
+ my $p = &URI::file::Win32::file;
+ return unless defined $p;
+ $p =~ s,\\,/,g;
+ $p;
+}
+
+1;