瀏覽代碼

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

Simon Krajewski 12 年之前
父節點
當前提交
715f8790d5
共有 3 個文件被更改,包括 3 次插入3 次删除
  1. 1 1
      std/cpp/_std/sys/FileSystem.hx
  2. 1 1
      std/neko/_std/sys/FileSystem.hx
  3. 1 1
      std/php/_std/sys/FileSystem.hx

+ 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
 		}
 	}