280-fix_find_regression.patch 890 B

12345678910111213141516171819202122232425262728293031
  1. find: fix regression in status processing for path arguments
  2. Regression added in commit 14158b4127dba30466c50147b868a6a89702960b
  3. "find: add optional support for '-exec ... {} +'"
  4. This commit causes find to exit on the first path argument that was not
  5. found, which breaks existing scripts and is incompatible to other
  6. implementations.
  7. Instead of exiting on the first failure, return EXIT_FAILURE at the end
  8. if any error occurred.
  9. Signed-off-by: Felix Fietkau <nbd@openwrt.org>
  10. --- a/findutils/find.c
  11. +++ b/findutils/find.c
  12. @@ -1460,12 +1460,10 @@ int find_main(int argc UNUSED_PARAM, cha
  13. NULL, /* user data */
  14. 0) /* depth */
  15. ) {
  16. - status = EXIT_FAILURE;
  17. - goto out;
  18. + status |= EXIT_FAILURE;
  19. }
  20. }
  21. - IF_FEATURE_FIND_EXEC_PLUS(status = flush_exec_plus();)
  22. -out:
  23. + IF_FEATURE_FIND_EXEC_PLUS(status |= flush_exec_plus();)
  24. return status;
  25. }