summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2016-03-05 13:13:08 +0100
committerRémi Verschelde <remi@verschelde.fr>2016-03-05 13:13:08 +0100
commit21335e502cfb2ad2cfc62aafd1fa621823c9089d (patch)
tree25880b52be7f2eb71ca0dec365b758967630df9c /platform
parent6b1ca582f94b23e000e8c930586bf980e12e622c (diff)
parentd7052ddba334de3df1190837c6d8589b48799965 (diff)
Merge pull request #3893 from leezh/diraccess_fix
Added relative paths for DirAccess::remove()
Diffstat (limited to 'platform')
-rw-r--r--platform/flash/dir_access_flash.cpp4
-rw-r--r--platform/osx/dir_access_osx.mm7
2 files changed, 7 insertions, 4 deletions
diff --git a/platform/flash/dir_access_flash.cpp b/platform/flash/dir_access_flash.cpp
index 443242fd99..ce9eed2c59 100644
--- a/platform/flash/dir_access_flash.cpp
+++ b/platform/flash/dir_access_flash.cpp
@@ -183,12 +183,12 @@ size_t DirAccessFlash::get_space_left() {
Error DirAccessFlash::rename(String p_from, String p_to) {
- return FAILED;
+ ERR_FAIL_V(ERR_UNAVAILABLE);
};
Error DirAccessFlash::remove(String p_name) {
- return FAILED;
+ ERR_FAIL_V(ERR_UNAVAILABLE);
};
extern char* psp_drive;
diff --git a/platform/osx/dir_access_osx.mm b/platform/osx/dir_access_osx.mm
index e345bea60a..29f8fda663 100644
--- a/platform/osx/dir_access_osx.mm
+++ b/platform/osx/dir_access_osx.mm
@@ -297,8 +297,11 @@ Error DirAccessOSX::rename(String p_path,String p_new_path) {
}
Error DirAccessOSX::remove(String p_path) {
- p_path=fix_path(p_path);
-
+ if (p_path.is_rel_path())
+ p_path=get_current_dir().plus_file(p_path);
+ else
+ p_path=fix_path(p_path);
+
struct stat flags;
if ((stat(p_path.utf8().get_data(),&flags)!=0))
return FAILED;