diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-04-18 20:11:33 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-04-18 20:11:33 -0300 |
commit | 1de1a04b78b65254aa41d7930947df82a121160c (patch) | |
tree | c51274eec2728cf22c4e7d067dec8f8c10c9c225 /platform/android | |
parent | b66b86b05eca3b557700d0249fc3874099056638 (diff) |
-fix local and global usage for DirAccess, fixes #791
please test anyway..
Diffstat (limited to 'platform/android')
-rw-r--r-- | platform/android/dir_access_jandroid.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/platform/android/dir_access_jandroid.cpp b/platform/android/dir_access_jandroid.cpp index 37aecc77a6..3d2926b4fc 100644 --- a/platform/android/dir_access_jandroid.cpp +++ b/platform/android/dir_access_jandroid.cpp @@ -176,7 +176,7 @@ bool DirAccessJAndroid::file_exists(String p_file){ if (current_dir=="") sd=p_file; else - sd=current_dir+"/"+p_file; + sd=current_dir.plus_file(p_file); FileAccessJAndroid *f = memnew(FileAccessJAndroid); bool exists = f->file_exists(sd); @@ -190,12 +190,19 @@ bool DirAccessJAndroid::dir_exists(String p_dir) { JNIEnv *env = ThreadAndroid::get_env(); String sd; + + if (current_dir=="") sd=p_dir; - else - sd=current_dir+"/"+p_dir; + else { + if (p_dir.is_rel_path()) + sd=current_dir.plus_file(p_dir); + else + sd=fix_path(p_dir); + } + + String path=sd.simplify_path(); - String path=fix_path(sd).simplify_path(); if (path.begins_with("/")) path=path.substr(1,path.length()); else if (path.begins_with("res://")) |