X-Git-Url: https://git.saurik.com/apple/shell_cmds.git/blobdiff_plain/ddb4a88b2f582f98073e02a797c5299d71d9527e..HEAD:/find/option.c diff --git a/find/option.c b/find/option.c index 9ff7451..5771da4 100644 --- a/find/option.c +++ b/find/option.c @@ -13,10 +13,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. @@ -41,7 +37,7 @@ static char sccsid[] = "@(#)option.c 8.2 (Berkeley) 4/16/94"; #endif /* not lint */ #include -__FBSDID("$FreeBSD: src/usr.bin/find/option.c,v 1.26 2008/02/23 16:29:04 imp Exp $"); +__FBSDID("$FreeBSD: src/usr.bin/find/option.c,v 1.32 2011/05/27 22:14:49 jilles Exp $"); #include #include @@ -55,7 +51,7 @@ __FBSDID("$FreeBSD: src/usr.bin/find/option.c,v 1.26 2008/02/23 16:29:04 imp Exp #include "find.h" -int typecompare(const void *, const void *); +static int typecompare(const void *, const void *); /* NB: the following table must be sorted lexically. */ /* Options listed with C++ comments are in gnu find, but not our find */ @@ -67,9 +63,7 @@ static OPTION const options[] = { { "-Bnewer", c_newer, f_newer, F_TIME_B }, { "-Btime", c_Xtime, f_Xtime, F_TIME_B }, { "-a", c_and, NULL, 0 }, -#ifndef __APPLE__ { "-acl", c_acl, f_acl, 0 }, -#endif /* !__APPLE__ */ { "-amin", c_Xmin, f_Xmin, F_TIME_A }, { "-and", c_and, NULL, 0 }, { "-anewer", c_newer, f_newer, F_TIME_A }, @@ -156,6 +150,10 @@ static OPTION const options[] = { { "-uid", c_user, f_user, 0 }, { "-user", c_user, f_user, 0 }, { "-wholename", c_name, f_path, 0 }, +#ifdef __APPLE__ + { "-xattr", c_simple, f_xattr, 0 }, + { "-xattrname", c_name, f_xattrname, 0 }, +#endif /* __APPLE__ */ { "-xdev", c_xdev, f_always_true, 0 }, // -xtype }; @@ -178,7 +176,7 @@ find_create(char ***argvp) argv = *argvp; if ((p = lookup_option(*argv)) == NULL) - errx(1, "%s: unknown option", *argv); + errx(1, "%s: unknown primary or operator", *argv); ++argv; new = (p->create)(p, &argv); @@ -196,7 +194,7 @@ lookup_option(const char *name) sizeof(options)/sizeof(OPTION), sizeof(OPTION), typecompare)); } -int +static int typecompare(const void *a, const void *b) { return (strcmp(((const OPTION *)a)->name, ((const OPTION *)b)->name));