aboutsummaryrefslogtreecommitdiff
path: root/findutils
diff options
context:
space:
mode:
Diffstat (limited to 'findutils')
-rw-r--r--findutils/find.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/findutils/find.c b/findutils/find.c
index f72cad7d1..bd7ccc323 100644
--- a/findutils/find.c
+++ b/findutils/find.c
@@ -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);
}