[PATCH] find: implement -ok

Denys Vlasenko vda.linux at googlemail.com
Tue Mar 28 16:13:29 UTC 2023


On Sun, Jan 29, 2023 at 3:14 AM David Leonard
<d+busybox at adaptive-enterprises.com> wrote:
> Resending patch for 'find -ok'. I re-ran bloatcheck (x86_64).

findutils/find.c: In function ‘do_exec’:
findutils/find.c:837:12: error: ‘rc’ may be used uninitialized in this
function [-Werror=maybe-uninitialized]
  837 |  return rc == 0; /* return 1 if exitcode 0 */
      |         ~~~^~~~

This is indeed the case (rc is used uninitialized).

> +testing "find -ok" \
> +       "cd find.tempdir && find testfile -ok true {} + 2>&1; echo \$?" \
> +       "true testfile ?\n0\n" \
> +       "" "y"

The test actually failed (extra "\n").

"-ok CMD +" is not accepted by GNU findutils 4.9.0>

Fixing the test.

Applied the result. Thank you.


More information about the busybox mailing list