From 196e81c5fb2c249d70c89dc62e1829fee047320a Mon Sep 17 00:00:00 2001 From: Connor Lane Smith Date: Fri, 25 May 2012 21:55:31 +0100 Subject: [PATCH] rm: removing empty dirs is okay --- rm.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/rm.c b/rm.c index 3545fc2..df68c6b 100644 --- a/rm.c +++ b/rm.c @@ -11,7 +11,6 @@ int main(int argc, char *argv[]) { char c; - struct stat st; while((c = getopt(argc, argv, "fr")) != -1) switch(c) { @@ -24,12 +23,7 @@ main(int argc, char *argv[]) default: exit(EXIT_FAILURE); } - for(; optind < argc; optind++) { - if(!rm_rflag && stat(argv[optind], &st) == 0 && - S_ISDIR(st.st_mode)) - fprintf(stderr, "%s: is a directory\n", argv[optind]); - else - rm(argv[optind]); - } + for(; optind < argc; optind++) + rm(argv[optind]); return EXIT_SUCCESS; }