File tree 5 files changed +12
-0
lines changed
5 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -1189,6 +1189,7 @@ module StdFileSystem = struct
1189
1189
1190
1190
let patch_path s =
1191
1191
if String. length s > 1 && String. length s < = 3 && s.[1 ] = ':' then Path. add_trailing_slash s
1192
+ else if s = " /" then " /"
1192
1193
else remove_trailing_slash s
1193
1194
1194
1195
let createDirectory = vfun1 (fun path ->
Original file line number Diff line number Diff line change @@ -104,6 +104,8 @@ class FileSystem {
104
104
private static inline function makeCompatiblePath (path : String ): String {
105
105
return if (path .charCodeAt (1 ) == " :" .code && path .length <= 3 ) {
106
106
haxe.io. Path .addTrailingSlash (path );
107
+ } else if (path == " /" ) {
108
+ " /" ;
107
109
} else {
108
110
haxe.io. Path .removeTrailingSlashes (path );
109
111
}
Original file line number Diff line number Diff line change @@ -102,6 +102,8 @@ class FileSystem {
102
102
private static inline function makeCompatiblePath (path : String ): String {
103
103
return if (path .charCodeAt (1 ) == " :" .code && path .length <= 3 ) {
104
104
haxe.io. Path .addTrailingSlash (path );
105
+ } else if (path == " /" ) {
106
+ " /" ;
105
107
} else {
106
108
haxe.io. Path .removeTrailingSlashes (path );
107
109
}
Original file line number Diff line number Diff line change @@ -104,6 +104,8 @@ class FileSystem {
104
104
private static inline function makeCompatiblePath (path : String ): String {
105
105
return if (path .charCodeAt (1 ) == " :" .code && path .length <= 3 ) {
106
106
haxe.io. Path .addTrailingSlash (path );
107
+ } else if (path == " /" ) {
108
+ " /" ;
107
109
} else {
108
110
haxe.io. Path .removeTrailingSlashes (path );
109
111
}
Original file line number Diff line number Diff line change @@ -94,6 +94,11 @@ class TestFileSystem extends utest.Test {
94
94
}
95
95
}
96
96
97
+ function testRootExists () {
98
+ Assert .isTrue (FileSystem .exists (" /" ));
99
+ Assert .isTrue (FileSystem .stat (" /" ) != null );
100
+ }
101
+
97
102
function testWindowsSpecialCases () {
98
103
if (Sys .systemName () != " Windows" #if python || true #end) {
99
104
Assert .isTrue (true );
You can’t perform that action at this time.
0 commit comments