You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
-fix local and global usage for DirAccess, fixes #791
please test anyway..
This commit is contained in:
@@ -87,7 +87,7 @@ bool DirAccessUnix::dir_exists(String p_dir) {
|
||||
|
||||
|
||||
if (p_dir.is_rel_path())
|
||||
p_dir=current_dir+"/"+p_dir;
|
||||
p_dir=get_current_dir().plus_file(p_dir);
|
||||
else
|
||||
p_dir=fix_path(p_dir);
|
||||
|
||||
@@ -278,9 +278,16 @@ String DirAccessUnix::get_current_dir() {
|
||||
|
||||
Error DirAccessUnix::rename(String p_path,String p_new_path) {
|
||||
|
||||
p_path=fix_path(p_path);
|
||||
p_new_path=fix_path(p_new_path);
|
||||
|
||||
if (p_path.is_rel_path())
|
||||
p_path=get_current_dir().plus_file(p_path);
|
||||
else
|
||||
p_path=fix_path(p_path);
|
||||
|
||||
if (p_new_path.is_rel_path())
|
||||
p_new_path=get_current_dir().plus_file(p_new_path);
|
||||
else
|
||||
p_new_path=fix_path(p_new_path);
|
||||
|
||||
return ::rename(p_path.utf8().get_data(),p_new_path.utf8().get_data())==0?OK:FAILED;
|
||||
}
|
||||
Error DirAccessUnix::remove(String p_path) {
|
||||
|
||||
Reference in New Issue
Block a user