summaryrefslogtreecommitdiff
path: root/drivers/unix
diff options
context:
space:
mode:
authorZher Huei Lee <lee.zh.92@gmail.com>2016-03-01 10:40:31 +0000
committerZher Huei Lee <lee.zh.92@gmail.com>2016-03-01 10:40:31 +0000
commitd7052ddba334de3df1190837c6d8589b48799965 (patch)
tree1c53ccbfc0d9edcece7f158d58f25649d0051926 /drivers/unix
parentc0382a1731b2979ad6231720372dc850b2cd4db9 (diff)
Added relative paths for DirAccess::remove()
Follows similar behaviour to DirAccess::rename()
Diffstat (limited to 'drivers/unix')
-rw-r--r--drivers/unix/dir_access_unix.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/unix/dir_access_unix.cpp b/drivers/unix/dir_access_unix.cpp
index 23a63be339..8b097ad25e 100644
--- a/drivers/unix/dir_access_unix.cpp
+++ b/drivers/unix/dir_access_unix.cpp
@@ -292,8 +292,11 @@ Error DirAccessUnix::rename(String p_path,String p_new_path) {
}
Error DirAccessUnix::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;