aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2006-10-29 19:07:01 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2006-10-29 19:07:01 +0000
commit5d499e1600e2fd627fba035faf3cb78f6333dcde (patch)
tree52f5401ce1e1ee881aaa656ce94764a92fad7609 /libbb
parente2fb719ba3463955f349ce63228981943f00bfaa (diff)
downloadbusybox-5d499e1600e2fd627fba035faf3cb78f6333dcde.tar.gz
find: a lot more compliant to 'standard' find
(we were not respecting order of actions!). Add -o and -a handling.
Diffstat (limited to 'libbb')
-rw-r--r--libbb/recursive_action.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libbb/recursive_action.c b/libbb/recursive_action.c
index ddaf9b896..05ff5d84f 100644
--- a/libbb/recursive_action.c
+++ b/libbb/recursive_action.c
@@ -27,7 +27,14 @@ static int true_action(const char *fileName, struct stat *statbuf, void* userDat
return TRUE;
}
-/*
+/* fileAction return value of 0 on any file in directory will make
+ * recursive_action() return 0, but it doesn't stop directory traversal
+ * (fileAction/dirAction will be called on each file).
+ *
+ * if !depthFirst, dirAction return value of 0 (FALSE) or 2 (SKIP)
+ * prevents recursion into that directory, instead
+ * recursive_action() returns 0 (if FALSE) or 1 (if SKIP).
+ *
* followLinks=0/1 differs mainly in handling of links to dirs.
* 0: lstat(statbuf). Calls fileAction on link name even if points to dir.
* 1: stat(statbuf). Calls dirAction and optionally recurse on link to dir.