summaryrefslogtreecommitdiffstats
path: root/usr.bin/find/find.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2001-05-03 18:05:35 +0000
committerphk <phk@FreeBSD.org>2001-05-03 18:05:35 +0000
commite51263b8a6769bca310145953de7cb2a93696e64 (patch)
tree9eec6ef5730dc41824c3e49c7f3642ecef218180 /usr.bin/find/find.c
parentd7b11c99fc99c4b8a79d95f29ec61a701a8956f2 (diff)
downloadFreeBSD-src-e51263b8a6769bca310145953de7cb2a93696e64.zip
FreeBSD-src-e51263b8a6769bca310145953de7cb2a93696e64.tar.gz
They add the following commands:
-anewer -cnewer -mnewer -okdir -newer[acm][acmt] With it, you can form queries like find . -newerct '1 minute ago' -print As an extra bonus, the program is ANSI-fied - the original version relies on some obscure features of K&R C. (This PR was submitted in 1999, and the submittor has kept the patch updated ever since, hats off for him guys, and how about you close a PR ??) PR: 9374 Submitted by: Martin Birgmeier <Martin.Birgmeier@aon.at>
Diffstat (limited to 'usr.bin/find/find.c')
-rw-r--r--usr.bin/find/find.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/usr.bin/find/find.c b/usr.bin/find/find.c
index ce2595e..b10715b 100644
--- a/usr.bin/find/find.c
+++ b/usr.bin/find/find.c
@@ -116,17 +116,24 @@ find_formplan(argv)
* necessary, and add a -print node on the end.
*/
if (!isoutput) {
+ OPTION *p;
+ char **argv = 0;
+
if (plan == NULL) {
- new = c_print();
+ p = option("-print");
+ new = (p->create)(p, &argv);
tail = plan = new;
} else {
- new = c_openparen();
+ p = option("(");
+ new = (p->create)(p, &argv);
new->next = plan;
plan = new;
- new = c_closeparen();
+ p = option(")");
+ new = (p->create)(p, &argv);
tail->next = new;
tail = new;
- new = c_print();
+ p = option("-print");
+ new = (p->create)(p, &argv);
tail->next = new;
tail = new;
}
@@ -220,7 +227,7 @@ find_execute(plan, paths)
* false or all have been executed. This is where we do all
* the work specified by the user on the command line.
*/
- for (p = plan; p && (p->eval)(p, entry); p = p->next);
+ for (p = plan; p && (p->execute)(p, entry); p = p->next);
if (maxdepth != -1 && entry->fts_level >= maxdepth) {
if (fts_set(tree, entry, FTS_SKIP))
OpenPOWER on IntegriCloud