summaryrefslogtreecommitdiff
path: root/rm.c
diff options
context:
space:
mode:
Diffstat (limited to 'rm.c')
-rw-r--r--rm.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/rm.c b/rm.c
index 275c059..c93a94c 100644
--- a/rm.c
+++ b/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);