1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

os: fix os.rmdir_all for folders with recursive symlinks

This commit is contained in:
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

View File

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