File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ static Error _erase_recursive(DirAccess *da) {
8484 String n = da->get_next ();
8585 while (!n.is_empty ()) {
8686 if (n != " ." && n != " .." ) {
87- if (da->current_is_dir ()) {
87+ if (da->current_is_dir () && !da-> is_link (n) ) {
8888 dirs.push_back (n);
8989 } else {
9090 files.push_back (n);
Original file line number Diff line number Diff line change @@ -419,7 +419,7 @@ Error DirAccessUnix::remove(String p_path) {
419419 return FAILED;
420420 }
421421
422- if (S_ISDIR (flags.st_mode )) {
422+ if (S_ISDIR (flags.st_mode ) && ! is_link (p_path) ) {
423423 return ::rmdir (p_path.utf8 ().get_data ()) == 0 ? OK : FAILED;
424424 } else {
425425 return ::unlink (p_path.utf8 ().get_data ()) == 0 ? OK : FAILED;
@@ -435,7 +435,7 @@ bool DirAccessUnix::is_link(String p_file) {
435435
436436 struct stat flags = {};
437437 if ((lstat (p_file.utf8 ().get_data (), &flags) != 0 )) {
438- return FAILED ;
438+ return false ;
439439 }
440440
441441 return S_ISLNK (flags.st_mode );
You can’t perform that action at this time.
0 commit comments