]> gitweb.factorcode.org Git - factor.git/commitdiff
fixed handling of UNC paths under windows
author8byte-jose <8byte.jose@gmail.com>
Tue, 25 Jan 2011 12:32:21 +0000 (13:32 +0100)
committer8byte-jose <8byte.jose@gmail.com>
Tue, 25 Jan 2011 12:32:21 +0000 (13:32 +0100)
basis/io/files/windows/windows.factor

index 6a83fcec273e0ab758e5b27847a887cf17595258..4b0c8cb130e7412b3cf8aa7894717f11ffc3690d 100755 (executable)
@@ -325,9 +325,14 @@ M: winnt root-directory? ( path -- ? )
 TR: normalize-separators "/" "\\" ;
 
 M: winnt normalize-path ( string -- string' )
-    absolute-path
-    normalize-separators
-    prepend-prefix ;
+    dup [ "//" head? ] [ "\\\\" head? ] bi
+    or [
+        normalize-separators
+    ] [
+        absolute-path
+        normalize-separators
+        prepend-prefix
+    ] if ;
 
 M: winnt CreateFile-flags ( DWORD -- DWORD )
     FILE_FLAG_OVERLAPPED bitor ;