=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/find/function.c,v retrieving revision 1.17 retrieving revision 1.18 diff -c -r1.17 -r1.18 *** src/usr.bin/find/function.c 1999/12/04 22:42:32 1.17 --- src/usr.bin/find/function.c 2000/06/07 15:25:30 1.18 *************** *** 1,4 **** ! /* $OpenBSD: function.c,v 1.17 1999/12/04 22:42:32 millert Exp $ */ /*- * Copyright (c) 1990, 1993 --- 1,4 ---- ! /* $OpenBSD: function.c,v 1.18 2000/06/07 15:25:30 deraadt Exp $ */ /*- * Copyright (c) 1990, 1993 *************** *** 38,44 **** #ifndef lint /*static char sccsid[] = "from: @(#)function.c 8.1 (Berkeley) 6/6/93";*/ ! static char rcsid[] = "$OpenBSD: function.c,v 1.17 1999/12/04 22:42:32 millert Exp $"; #endif /* not lint */ #include --- 38,44 ---- #ifndef lint /*static char sccsid[] = "from: @(#)function.c 8.1 (Berkeley) 6/6/93";*/ ! static char rcsid[] = "$OpenBSD: function.c,v 1.18 2000/06/07 15:25:30 deraadt Exp $"; #endif /* not lint */ #include *************** *** 907,912 **** --- 907,937 ---- PLAN *new; new = palloc(N_NAME, f_name); + new->c_data = pattern; + return (new); + } + + /* + * -iname functions -- + * + * Similar to -name, but does case insensitive matching + * + */ + int + f_iname(plan, entry) + PLAN *plan; + FTSENT *entry; + { + return (!fnmatch(plan->c_data, entry->fts_name, FNM_CASEFOLD)); + } + + PLAN * + c_iname(pattern) + char *pattern; + { + PLAN *new; + + new = palloc(N_INAME, f_iname); new->c_data = pattern; return (new); }