summaryrefslogtreecommitdiffstats
path: root/usr.bin/find
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1998-11-29 11:11:07 +0000
committerbde <bde@FreeBSD.org>1998-11-29 11:11:07 +0000
commit767b0be6c5d4c0f7aafac5453d0891a7fe3fa06e (patch)
tree510f85ff25f6fc7122b81fae626bf2ead7211888 /usr.bin/find
parent095dc8ca5de530a16a744b3c238ef6979215fa5a (diff)
downloadFreeBSD-src-767b0be6c5d4c0f7aafac5453d0891a7fe3fa06e.zip
FreeBSD-src-767b0be6c5d4c0f7aafac5453d0891a7fe3fa06e.tar.gz
Fixed style bugs and English in previous commit.
Diffstat (limited to 'usr.bin/find')
-rw-r--r--usr.bin/find/find.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/usr.bin/find/find.c b/usr.bin/find/find.c
index c63362a..47a4e9f 100644
--- a/usr.bin/find/find.c
+++ b/usr.bin/find/find.c
@@ -50,7 +50,20 @@ static char sccsid[] = "@(#)find.c 8.5 (Berkeley) 8/5/94";
#include "find.h"
-static int find_compare(const FTSENT **s1, const FTSENT **s2);
+static int find_compare __P((const FTSENT **s1, const FTSENT **s2));
+
+/*
+ * find_compare --
+ * tell fts_open() how to order the traversal of the hierarchy.
+ * This variant gives lexicographical order in each directory.
+ */
+static int
+find_compare(s1, s2)
+ const FTSENT **s1, **s2;
+{
+
+ return (strcoll((*s1)->fts_name, (*s2)->fts_name));
+}
/*
* find_formplan --
@@ -144,18 +157,6 @@ find_formplan(argv)
FTS *tree; /* pointer to top of FTS hierarchy */
/*
- * find_compare --
- * A function which be used in fts_open() to order the
- * traversal of the hierarchy.
- * This function give you a lexicographical sorted output.
- */
-static int find_compare(s1, s2)
- const FTSENT **s1, **s2;
-{
- return strcoll( (*s1)->fts_name, (*s2)->fts_name );
-}
-
-/*
* find_execute --
* take a search plan and an array of search paths and executes the plan
* over all FTSENT's returned for the given search paths.
@@ -169,8 +170,8 @@ find_execute(plan, paths)
PLAN *p;
int rval;
- if ((tree = fts_open(paths, ftsoptions,
- (issort ? find_compare : NULL) )) == NULL)
+ tree = fts_open(paths, ftsoptions, (issort ? find_compare : NULL));
+ if (tree == NULL)
err(1, "ftsopen");
for (rval = 0; (entry = fts_read(tree)) != NULL;) {
OpenPOWER on IntegriCloud