[hackers] [sbase][PATCH] rm: Fix early return bug caused by stray semicolon when checking for -i flag

From: ryhpez <tahamedhous_AT_gmail.com>
Date: Tue, 10 Jun 2025 15:33:00 +0100

this patch cleans up a small bug in the rm utility, there was a stray semicolon after the confirm() check for the -i flag, which made the function return early instead of proceeding with the removal when confirm() returned 1.

---
 libutil/rm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libutil/rm.c b/libutil/rm.c
index fb99840..56e3469 100644
--- a/libutil/rm.c
+++ b/libutil/rm.c
_AT_@ -28,7 +28,7 @@ rm(int dirfd, const char *name, struct stat *st, void *data, struct recursor *r)
 	}
 
 	if (!quiet && (!write && isatty(0) || ask)) {
-		if (!confirm("remove file '%s'", r->path));
+		if (!confirm("remove file '%s'", r->path))
 			return;
 	}
 
-- 
2.49.0
Received on Tue Jun 10 2025 - 16:33:00 CEST

This archive was generated by hypermail 2.3.0 : Tue Jun 10 2025 - 17:12:37 CEST