mirror of
https://github.com/sheumann/hush.git
synced 2024-12-22 14:30:31 +00:00
find: support "find . -delete" idiom - do not try rmdir(".")
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
305958dbd4
commit
8c0708a329
@ -768,7 +768,10 @@ ACTF(delete)
|
||||
{
|
||||
int rc;
|
||||
if (S_ISDIR(statbuf->st_mode)) {
|
||||
rc = rmdir(fileName);
|
||||
/* "find . -delete" skips rmdir(".") */
|
||||
rc = 0;
|
||||
if (NOT_LONE_CHAR(fileName, '.'))
|
||||
rc = rmdir(fileName);
|
||||
} else {
|
||||
rc = unlink(fileName);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user