Deleted Added
full compact
find.c (41399) find.c (61575)
1/*-
2 * Copyright (c) 1991, 1993, 1994
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Cimarron D. Taylor of the University of California, Berkeley.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 21 unchanged lines hidden (view full) ---

30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 */
36
37#ifndef lint
1/*-
2 * Copyright (c) 1991, 1993, 1994
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Cimarron D. Taylor of the University of California, Berkeley.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 21 unchanged lines hidden (view full) ---

30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 */
36
37#ifndef lint
38#if 0
38static char sccsid[] = "@(#)find.c 8.5 (Berkeley) 8/5/94";
39static char sccsid[] = "@(#)find.c 8.5 (Berkeley) 8/5/94";
40#else
41static const char rcsid[] =
42 "$FreeBSD: head/usr.bin/find/find.c 61575 2000-06-12 11:12:41Z roberto $";
43#endif
39#endif /* not lint */
40
41#include <sys/types.h>
42#include <sys/stat.h>
43
44#include <err.h>
45#include <errno.h>
46#include <fts.h>

--- 154 unchanged lines hidden (view full) ---

201#define BADCH " \t\n\\'\""
202 if (isxargs && strpbrk(entry->fts_path, BADCH)) {
203 (void)fflush(stdout);
204 warnx("%s: illegal path", entry->fts_path);
205 rval = 1;
206 continue;
207 }
208
44#endif /* not lint */
45
46#include <sys/types.h>
47#include <sys/stat.h>
48
49#include <err.h>
50#include <errno.h>
51#include <fts.h>

--- 154 unchanged lines hidden (view full) ---

206#define BADCH " \t\n\\'\""
207 if (isxargs && strpbrk(entry->fts_path, BADCH)) {
208 (void)fflush(stdout);
209 warnx("%s: illegal path", entry->fts_path);
210 rval = 1;
211 continue;
212 }
213
214 if (mindepth != -1 && entry->fts_level < mindepth)
215 continue;
216
209 /*
210 * Call all the functions in the execution plan until one is
211 * false or all have been executed. This is where we do all
212 * the work specified by the user on the command line.
213 */
214 for (p = plan; p && (p->eval)(p, entry); p = p->next);
217 /*
218 * Call all the functions in the execution plan until one is
219 * false or all have been executed. This is where we do all
220 * the work specified by the user on the command line.
221 */
222 for (p = plan; p && (p->eval)(p, entry); p = p->next);
223
224 if (maxdepth != -1 && entry->fts_level >= maxdepth) {
225 if (fts_set(tree, entry, FTS_SKIP))
226 err(1, "%s", entry->fts_path);
227 continue;
228 }
215 }
216 if (errno)
217 err(1, "fts_read");
218 return (rval);
219}
229 }
230 if (errno)
231 err(1, "fts_read");
232 return (rval);
233}