projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
305958d
)
find: support "find . -delete" idiom - do not try rmdir(".")
author
Denys Vlasenko
<vda.linux@googlemail.com>
Wed, 7 Oct 2015 19:01:47 +0000
(21:01 +0200)
committer
Denys Vlasenko
<vda.linux@googlemail.com>
Wed, 7 Oct 2015 19:01:47 +0000
(21:01 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
findutils/find.c
patch
|
blob
|
history
diff --git
a/findutils/find.c
b/findutils/find.c
index f72cad7d171acfb7915800b9c859a6df2fc610b4..bd7ccc323f32876805ed7efbbc92bc0b7cf5004f 100644
(file)
--- 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);
}