Roberto E. Vargas Caballero
unread,Apr 22, 2025, 7:59:01 AMApr 22Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to d...@suckless.org, Roberto E. Vargas Caballero
Quoting POSIX:
The following exit values shall be returned: 0 All requested files (excluding files where a non-affirmative response was given to a request for confirmation) were successfully copied. >0 An error occurred.
---
libutil/cp.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/libutil/cp.c b/libutil/cp.c
index cd94858..2ab32a0 100644
--- a/libutil/cp.c
+++ b/libutil/cp.c
@@ -44,10 +44,8 @@ cp(const char *s1, const char *s2, int depth)
}
if (cp_iflag && access(s2, F_OK) == 0) {
- if (!confirm("overwrite '%s'? ", s2)) {
- cp_status = 1;
+ if (!confirm("overwrite '%s'? ", s2))
return 0;
- }
}
if (cp_vflag)
--
2.46.1