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:
@@ -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
|
||||
|
Reference in New Issue
Block a user