Explorar el Código

remove trailing slashes on FileSystem.exists (closes #2577)

Simon Krajewski hace 11 años
padre
commit
86e93b04ae
Se han modificado 2 ficheros con 2 adiciones y 2 borrados
  1. 1 1
      std/cpp/_std/sys/FileSystem.hx
  2. 1 1
      std/neko/_std/sys/FileSystem.hx

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

@@ -31,7 +31,7 @@ private enum FileKind {
 class FileSystem {
 
 	public static inline function exists( path : String ) : Bool {
-		return sys_exists(path);
+		return sys_exists(haxe.io.Path.removeTrailingSlashes(path));
 	}
 
 	public static function rename( path : String, newPath : String ) : Void {

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

@@ -31,7 +31,7 @@ private enum FileKind {
 class FileSystem {
 
 	public static function exists( path : String ) : Bool {
-		return sys_exists(untyped path.__s);
+		return sys_exists(untyped (haxe.io.Path.removeTrailingSlashes(path)).__s);
 	}
 
 	public static function rename( path : String, newPath : String ) : Void {