瀏覽代碼

symlinks in resources dir fix (#653)

Max Kowarski 6 年之前
父節點
當前提交
7a216bec4d
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      hxd/fs/LocalFileSystem.hx

+ 3 - 2
hxd/fs/LocalFileSystem.hx

@@ -192,6 +192,7 @@ class LocalFileSystem implements FileSystem {
 	var fileCache = new Map<String,{r:LocalEntry}>();
 	public var baseDir(default,null) : String;
 	public var convert(default,null) : FileConverter;
+	static var isWindows = Sys.systemName() == "Windows";
 
 	public function new( dir : String, configuration : String ) {
 		baseDir = dir;
@@ -263,7 +264,7 @@ class LocalFileSystem implements FileSystem {
 		if( f == null )
 			return null;
 		f = f.split("\\").join("/");
-		if( !check || (f == baseDir + path && sys.FileSystem.exists(f) && checkPath(f)) ) {
+		if( !check || ((!isWindows || (isWindows && f == baseDir + path)) && sys.FileSystem.exists(f) && checkPath(f)) ) {
 			e = new LocalEntry(this, path.split("/").pop(), path, f);
 			convert.run(e);
 		}
@@ -340,4 +341,4 @@ class LocalFileSystem implements FileSystem {
 	}
 }
 
-#end
+#end