Added relative paths for DirAccess::remove()

Follows similar behaviour to DirAccess::rename()
This commit is contained in:
Zher Huei Lee 2016-03-01 10:40:31 +00:00
parent c0382a1731
commit d7052ddba3
4 changed files with 17 additions and 8 deletions

View file

@ -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;