Upgrade DB_File to 1.56:
[p5sagit/p5-mst-13.2.git] / lib / File / Basename.pm
index 0442aed..e4863f8 100644 (file)
@@ -162,8 +162,8 @@ sub fileparse {
       ($dirpath,$basename) = ($fullname =~ /^(.*[:>\]])?(.*)/);
     }
   }
-  if ($fstype =~ /^MSDOS/i) {
-    ($dirpath,$basename) = ($fullname =~ /^(.*[:\\\/])?(.*)/);
+  if ($fstype =~ /^MS(DOS|Win32)/i) {
+    ($dirpath,$basename) = ($fullname =~ /^((?:.*[:\\\/])?)(.*)/);
     $dirpath .= '.\\' unless $dirpath =~ /[\\\/]$/;
   }
   elsif ($fstype =~ /^MacOS/i) {
@@ -173,10 +173,6 @@ sub fileparse {
     ($dirpath,$basename) = ($fullname =~ /(.*[:\/])?(.*)/);
     $dirpath = './' unless $dirpath;
   }
-  elsif ($fstype =~ /^MSWin32/i) {
-    ($dirpath,$basename) = ($fullname =~ /^(.*[:\\\/])?(.*)/);
-    $dirpath .= ".\\" unless $dirpath =~ /[\\\/]$/;
-  }
   elsif ($fstype !~ /^VMS/i) {  # default to Unix
     ($dirpath,$basename) = ($fullname =~ m#^(.*/)?(.*)#);
     $dirpath = './' unless $dirpath;