fix rm -f

This commit is contained in:
Connor Lane Smith 2011-05-24 12:32:33 +01:00
parent 4c6c379812
commit be6e177f6e
2 changed files with 6 additions and 3 deletions

2
rm.1
View File

@ -11,7 +11,7 @@ removes the given files and directories.
.SH OPTIONS
.TP
.B \-f
ignored, for compatibility.
ignore files that cannot be removed.
.TP
.B \-r
remove directories recursively.

7
rm.c
View File

@ -10,7 +10,8 @@
static void rm(const char *);
static bool rflag = 0;
static bool fflag = false;
static bool rflag = false;
int
main(int argc, char *argv[])
@ -20,6 +21,7 @@ main(int argc, char *argv[])
while((c = getopt(argc, argv, "fr")) != -1)
switch(c) {
case 'f':
fflag = true;
break;
case 'r':
rflag = true;
@ -54,5 +56,6 @@ void rm(const char *path)
if(remove(path) == 0)
return;
}
eprintf("remove %s:", path);
if(!fflag)
eprintf("remove %s:", path);
}