Jelajahi Sumber

symlinks in resources dir fix (#653)

Max Kowarski 6 tahun lalu
induk
melakukan
7a216bec4d
1 mengubah file dengan 3 tambahan dan 2 penghapusan
  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