mirror of https://github.com/sheumann/hush.git
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;
|
int rc;
|
||||||
if (S_ISDIR(statbuf->st_mode)) {
|
if (S_ISDIR(statbuf->st_mode)) {
|
||||||
rc = rmdir(fileName);
|
/* "find . -delete" skips rmdir(".") */
|
||||||
|
rc = 0;
|
||||||
|
if (NOT_LONE_CHAR(fileName, '.'))
|
||||||
|
rc = rmdir(fileName);
|
||||||
} else {
|
} else {
|
||||||
rc = unlink(fileName);
|
rc = unlink(fileName);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue