On Sun, Apr 20, 2025 at 09:22:10AM +0200, g...@suckless.org wrote:
> +             if (!confirm("overwrite '%s'? ", s2)) {
> +                     cp_status = 1;

I missed it when reviewing the fist time, but this, I'm pretty sure is
not correct. According to POSIX:

        
https://pubs.opengroup.org/onlinepubs/9799919799.2024edition/utilities/cp.html#tag_20_24
        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.

And so !confirm() must not count as an "error" return code. The earlier
version of the patch didn't modify `cp_status` which was the right
behavior.

- NRK

Reply via email to