os: fix os.rmdir_all for folders with recursive symlinks

pull/12527/head
Delyan Angelov 2021-11-20 10:24:18 +02:00
parent 1bbc73384c
commit 24ffc1ffb2
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
1 changed files with 1 additions and 1 deletions

View File

@ -135,7 +135,7 @@ pub fn rmdir_all(path string) ? {
items := ls(path) ?
for item in items {
fullpath := join_path(path, item)
if is_dir(fullpath) {
if is_dir(fullpath) && !is_link(fullpath) {
rmdir_all(fullpath) or { ret_err = err.msg }
} else {
rm(fullpath) or { ret_err = err.msg }