mirror of
https://git.busybox.net/busybox
synced 2026-02-07 20:50:26 +00:00
Only remove directories when removing recursively.
This commit is contained in:
parent
cff3fe3ae9
commit
7c22b77162
2 changed files with 10 additions and 0 deletions
|
|
@ -45,6 +45,11 @@ static int fileAction(const char *fileName, struct stat *statbuf, void* junk)
|
|||
|
||||
static int dirAction(const char *fileName, struct stat *statbuf, void* junk)
|
||||
{
|
||||
if (recursiveFlag == FALSE) {
|
||||
errno = EISDIR;
|
||||
perror(fileName);
|
||||
return (FALSE);
|
||||
}
|
||||
if (rmdir(fileName) < 0) {
|
||||
perror(fileName);
|
||||
return (FALSE);
|
||||
|
|
|
|||
5
rm.c
5
rm.c
|
|
@ -45,6 +45,11 @@ static int fileAction(const char *fileName, struct stat *statbuf, void* junk)
|
|||
|
||||
static int dirAction(const char *fileName, struct stat *statbuf, void* junk)
|
||||
{
|
||||
if (recursiveFlag == FALSE) {
|
||||
errno = EISDIR;
|
||||
perror(fileName);
|
||||
return (FALSE);
|
||||
}
|
||||
if (rmdir(fileName) < 0) {
|
||||
perror(fileName);
|
||||
return (FALSE);
|
||||
|
|
|
|||
Loading…
Reference in a new issue