sbase

suckless unix tools
git clone git://git.2f30.org/sbase
Log | Files | Refs | README | LICENSE

commit 196e81c5fb2c249d70c89dc62e1829fee047320a
parent 20d526391d7d7ad6fc64a4085e8fe88d5b350da3
Author: Connor Lane Smith <cls@lubutu.com>
Date:   Fri, 25 May 2012 21:55:31 +0100

rm: removing empty dirs is okay
Diffstat:
Mrm.c | 10++--------
1 file changed, 2 insertions(+), 8 deletions(-)

diff --git 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; }