[Unix / DirAccess] Fix removing directory symlinks with remove, ensure erase_contents_recursive is not following directory symlinks.

This commit is contained in:
bruvzg 2024-04-12 10:06:49 +03:00
parent b2f425fe68
commit 57fde36f31
No known key found for this signature in database
GPG key ID: 7960FCF39844EC38
2 changed files with 3 additions and 3 deletions

View file

@ -84,7 +84,7 @@ static Error _erase_recursive(DirAccess *da) {
String n = da->get_next();
while (!n.is_empty()) {
if (n != "." && n != "..") {
if (da->current_is_dir()) {
if (da->current_is_dir() && !da->is_link(n)) {
dirs.push_back(n);
} else {
files.push_back(n);