summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2019-08-02 21:23:24 -0400
committerJakob Kaivo <jkk@ung.org>2019-08-02 21:23:24 -0400
commitb33cf8ef880fd3fc68492ecf07c029c9494d75e7 (patch)
tree388bf11f741175204a58b0b79a05114b217578c4
parentf19602d27330a4ecadbb045ad9bb4e36ba8e13bf (diff)
clean up redundant return statements and conditionals
-rw-r--r--rm.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/rm.c b/rm.c
index 8ea35d2..20d0225 100644
--- a/rm.c
+++ b/rm.c
@@ -82,14 +82,8 @@ int rm(const char *p, const struct stat *st, int typeflag, struct FTW *f)
fprintf(stderr, "rm: %s: %s\n", p, strerror(errno));
retval = 1;
}
- return 0;
- }
-
- if (!rm_prompt(p)) {
- return 0;
- }
- if (unlink(p) != 0) {
+ } else if (rm_prompt(p) && unlink(p) != 0) {
fprintf(stderr, "rm: %s: %s\n", p, strerror(errno));
retval = 1;
}