diff options
author | Matt Kraai | 2000-09-20 23:10:21 +0000 |
---|---|---|
committer | Matt Kraai | 2000-09-20 23:10:21 +0000 |
commit | 7c22b771625cee60ca37be7c4cd27f2c360d0aba (patch) | |
tree | f68dd9314db9c30aefb9c3085262de5254223108 /coreutils/rm.c | |
parent | cff3fe3ae9696584f0c4bdad6860e8d94d5e99f9 (diff) | |
download | busybox-7c22b771625cee60ca37be7c4cd27f2c360d0aba.zip busybox-7c22b771625cee60ca37be7c4cd27f2c360d0aba.tar.gz |
Only remove directories when removing recursively.
Diffstat (limited to 'coreutils/rm.c')
-rw-r--r-- | coreutils/rm.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/coreutils/rm.c b/coreutils/rm.c index 275c059..c93a94c 100644 --- a/coreutils/rm.c +++ b/coreutils/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); |