Parcourir la source

ignore paths ending with : when creating directories to allow absolute Windows paths

Simon Krajewski il y a 12 ans
Parent
commit
715f8790d5

+ 1 - 1
std/cpp/_std/sys/FileSystem.hx

@@ -71,7 +71,7 @@ class FileSystem {
 		var parts = [while ((path = haxe.io.Path.directory(path)) != "") path];
 		parts.reverse();
 		for (part in parts) {
-			if (!exists(part) && sys_create_dir( part, 493 )==null)
+			if (part.charCodeAt(part.length - 1) != ":".code && !exists(part) && sys_create_dir( part, 493 )==null)
 				throw "Could not create directory:" + part;
 		}
 	}

+ 1 - 1
std/neko/_std/sys/FileSystem.hx

@@ -68,7 +68,7 @@ class FileSystem {
 		var parts = [while ((path = haxe.io.Path.directory(path)) != "") path];
 		parts.reverse();
 		for (part in parts) {
-			if (!exists(part))
+			if (part.charCodeAt(part.length - 1) != ":".code && !exists(part))
 				sys_create_dir( untyped part.__s, 493 );
 		}
 	}

+ 1 - 1
std/php/_std/sys/FileSystem.hx

@@ -81,7 +81,7 @@ class FileSystem {
 		var parts = [while ((path = haxe.io.Path.directory(path)) != "") path];
 		parts.reverse();
 		for (part in parts) {
-			if (!exists(part))
+			if (part.charCodeAt(part.length - 1) != ":".code && !exists(part))
 				untyped __call__("@mkdir", part, 493); // php default is 0777, neko is 0755
 		}
 	}