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