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.
This commit is contained in:
Roberto E. Vargas Caballero 2025-04-22 13:51:32 +02:00
parent 9e8b431075
commit 11492947de

View File

@ -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)