summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
Diffstat (limited to 'platform')
-rw-r--r--platform/android/dir_access_jandroid.cpp15
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://"))