浏览代码

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

Simon Krajewski 11 年之前
父节点
当前提交
86e93b04ae
共有 2 个文件被更改,包括 2 次插入2 次删除
  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 {