sbase

suckless unix tools
git clone git://git.suckless.org/sbase
Log | Files | Refs | README | LICENSE

commit 11492947deec4e54e67da8cf1934767f02d146c1
parent 9e8b431075c0901a58dda7eee3f18d97095896ca
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date:   Tue, 22 Apr 2025 13:51:32 +0200

cp: Don't modify status for -i

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.

Diffstat:
Mlibutil/cp.c | 4+---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git 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)