aboutsummaryrefslogtreecommitdiff
path: root/findutils/find.c
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2020-11-12 08:27:51 +0000
committerRon Yorston <rmy@pobox.com>2020-11-12 08:27:51 +0000
commitead8b92e3d66ab45235e137f85fb3a529dcc64ef (patch)
treeaf268270382dad969218063d4a8120fc91a9e631 /findutils/find.c
parent567728c22dddea4ed33b8a69641ba2e0c3f1f600 (diff)
parent64981b4c8e88812c322bee3832f1d421ff670ed5 (diff)
downloadbusybox-w32-ead8b92e3d66ab45235e137f85fb3a529dcc64ef.tar.gz
busybox-w32-ead8b92e3d66ab45235e137f85fb3a529dcc64ef.tar.bz2
busybox-w32-ead8b92e3d66ab45235e137f85fb3a529dcc64ef.zip
Merge branch 'busybox' into merge
Diffstat (limited to 'findutils/find.c')
-rw-r--r--findutils/find.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/findutils/find.c b/findutils/find.c
index 121f8fd03..f26c01c1e 100644
--- a/findutils/find.c
+++ b/findutils/find.c
@@ -889,10 +889,10 @@ ACTF(links)
889} 889}
890#endif 890#endif
891 891
892static int FAST_FUNC fileAction(const char *fileName, 892static int FAST_FUNC fileAction(
893 struct stat *statbuf, 893 struct recursive_state *state IF_NOT_FEATURE_FIND_MAXDEPTH(UNUSED_PARAM),
894 void *userData UNUSED_PARAM, 894 const char *fileName,
895 int depth IF_NOT_FEATURE_FIND_MAXDEPTH(UNUSED_PARAM)) 895 struct stat *statbuf)
896{ 896{
897 int r; 897 int r;
898 int same_fs = 1; 898 int same_fs = 1;
@@ -911,12 +911,12 @@ static int FAST_FUNC fileAction(const char *fileName,
911#endif 911#endif
912 912
913#if ENABLE_FEATURE_FIND_MAXDEPTH 913#if ENABLE_FEATURE_FIND_MAXDEPTH
914 if (depth < G.minmaxdepth[0]) { 914 if (state->depth < G.minmaxdepth[0]) {
915 if (same_fs) 915 if (same_fs)
916 return TRUE; /* skip this, continue recursing */ 916 return TRUE; /* skip this, continue recursing */
917 return SKIP; /* stop recursing */ 917 return SKIP; /* stop recursing */
918 } 918 }
919 if (depth > G.minmaxdepth[1]) 919 if (state->depth > G.minmaxdepth[1])
920 return SKIP; /* stop recursing */ 920 return SKIP; /* stop recursing */
921#endif 921#endif
922 922
@@ -927,7 +927,7 @@ static int FAST_FUNC fileAction(const char *fileName,
927 927
928#if ENABLE_FEATURE_FIND_MAXDEPTH 928#if ENABLE_FEATURE_FIND_MAXDEPTH
929 if (S_ISDIR(statbuf->st_mode)) { 929 if (S_ISDIR(statbuf->st_mode)) {
930 if (depth == G.minmaxdepth[1]) 930 if (state->depth == G.minmaxdepth[1])
931 return SKIP; 931 return SKIP;
932 } 932 }
933#endif 933#endif
@@ -1574,8 +1574,7 @@ int find_main(int argc UNUSED_PARAM, char **argv)
1574 G.recurse_flags,/* flags */ 1574 G.recurse_flags,/* flags */
1575 fileAction, /* file action */ 1575 fileAction, /* file action */
1576 fileAction, /* dir action */ 1576 fileAction, /* dir action */
1577 NULL, /* user data */ 1577 NULL) /* user data */
1578 0) /* depth */
1579 ) { 1578 ) {
1580 G.exitstatus |= EXIT_FAILURE; 1579 G.exitstatus |= EXIT_FAILURE;
1581 } 1580 }