[hackers] [sbase] rm: removing empty dirs is okay || Connor Lane Smith

From: <hg_AT_suckless.org>
Date: Fri, 25 May 2012 22:55:36 +0200 (CEST)

changeset: 139:006d2df8df29
tag: tip
user: Connor Lane Smith <cls_AT_lubutu.com>
date: Fri May 25 21:55:31 2012 +0100
files: rm.c
description:
rm: removing empty dirs is okay


diff -r dfc51b3c5b38 -r 006d2df8df29 rm.c
--- a/rm.c Fri May 25 21:52:01 2012 +0100
+++ b/rm.c Fri May 25 21:55:31 2012 +0100
_AT_@ -11,7 +11,6 @@
 main(int argc, char *argv[])
 {
         char c;
- struct stat st;
 
         while((c = getopt(argc, argv, "fr")) != -1)
                 switch(c) {
_AT_@ -24,12 +23,7 @@
                 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;
 }
Received on Fri May 25 2012 - 22:55:36 CEST

This archive was generated by hypermail 2.3.0 : Fri May 25 2012 - 23:00:12 CEST