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 |
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 |
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 |
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 } |
229 } 230 if (errno) 231 err(1, "fts_read"); 232 return (rval); 233} |