[hackers] [sbase] rm: fix confirmation for deleting files and add question mark || Hiltjo Posthuma

From: <git_AT_suckless.org>
Date: Mon, 3 Nov 2025 18:53:29 +0100 (CET)

commit 1bae669f236b9612eacd64554cfb39733157ef43
Author: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
AuthorDate: Mon Nov 3 18:52:11 2025 +0100
Commit: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
CommitDate: Mon Nov 3 18:52:11 2025 +0100

    rm: fix confirmation for deleting files and add question mark
    
    Answering 'y' to rm -i will now delete the file.

diff --git a/libutil/rm.c b/libutil/rm.c
index fb99840..08845f4 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;
         }
 
Received on Mon Nov 03 2025 - 18:53:29 CET

This archive was generated by hypermail 2.3.0 : Mon Nov 03 2025 - 19:00:41 CET