aboutsummaryrefslogtreecommitdiffstats
path: root/package/utils/busybox/patches/280-fix_find_regression.patch
blob: 50217506afd60e2fad16e908b6966666fd798667 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
find: fix regression in status processing for path arguments

Regression added in commit 14158b4127dba30466c50147b868a6a89702960b
"find: add optional support for '-exec ... {} +'"

This commit causes find to exit on the first path argument that was not
found, which breaks existing scripts and is incompatible to other
implementations.

Instead of exiting on the first failure, return EXIT_FAILURE at the end
if any error occurred.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>

--- a/findutils/find.c
+++ b/findutils/find.c
@@ -1460,12 +1460,10 @@ int find_main(int argc UNUSED_PARAM, cha
 				NULL,           /* user data */
 				0)              /* depth */
 		) {
-			status = EXIT_FAILURE;
-			goto out;
+			status |= EXIT_FAILURE;
 		}
 	}
 
-	IF_FEATURE_FIND_EXEC_PLUS(status = flush_exec_plus();)
-out:
+	IF_FEATURE_FIND_EXEC_PLUS(status |= flush_exec_plus();)
 	return status;
 }