[dev] [PATCH 1/2] rm: Add -i and cleanup rm()

2025-04-24 Thread Roberto E. Vargas Caballero
From: "Roberto E. Vargas Caballero" POSIX mandates that if the input of rm is a tty and it does not have write rights over a file/dir then it should ask for confirmation, in the same way that is done with the -i flag. To accomodate both things the code has been rearrenged a bit to have only one c

[dev] Improve rm(1)

2025-04-24 Thread Roberto E. Vargas Caballero
Rm didn't implemented the -i option, but it was also lacking many error messages that should be displayed in some conditions.

[dev] [PATCH 2/2] rm: Don't attempt to remove . or ..

2025-04-24 Thread Roberto E. Vargas Caballero
From: "Roberto E. Vargas Caballero" POSIX explicitely mandates to ignore . or .. to avoid pitfals like rm -r .* and no having files that begin with a dot. --- rm.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rm.c b/rm.c index 2391d68..1f23c09 100644 --- a/rm.c +++