0
0
mirror of https://github.com/vim/vim.git synced 2025-09-29 04:34:16 -04:00

patch 8.2.4696: delete() with "rf" argument does not report a failure

Problem:    delete() with "rf" argument does not report a failure.
Solution:   Return -1 if the directory could not be removed. (closes #10078)
This commit is contained in:
zeertzjq
2022-04-05 15:31:01 +01:00
committed by Bram Moolenaar
parent beb0ef1ab2
commit 478700336d
3 changed files with 15 additions and 1 deletions

View File

@@ -5017,13 +5017,16 @@ delete_recursive(char_u *name)
vim_snprintf((char *)NameBuff, MAXPATHL, "%s/%s", exp,
((char_u **)ga.ga_data)[i]);
if (delete_recursive(NameBuff) != 0)
// Remember the failure but continue deleting any further
// entries.
result = -1;
}
ga_clear_strings(&ga);
if (mch_rmdir(exp) != 0)
result = -1;
}
else
result = -1;
(void)mch_rmdir(exp);
vim_free(exp);
}
else