]> git.saurik.com Git - apple/shell_cmds.git/blobdiff - find/main.c
shell_cmds-175.tar.gz
[apple/shell_cmds.git] / find / main.c
index bad04a212ed6dc698a0b884921416f89f0699668..e95e6482e853a1fb4318633b470195ba4b63ab9f 100644 (file)
  * 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.
@@ -35,7 +31,7 @@
  */
 
 #ifndef lint
-char copyright[] =
+static const char copyright[] =
 "@(#) Copyright (c) 1990, 1993, 1994\n\
        The Regents of the University of California.  All rights reserved.\n";
 #endif /* not lint */
@@ -43,12 +39,12 @@ char copyright[] =
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)main.c     8.4 (Berkeley) 5/4/95";
-#else
-static const char rcsid[] =
-  "$FreeBSD: src/usr.bin/find/main.c,v 1.9.6.2 2001/02/25 21:56:59 knu Exp $";
 #endif
 #endif /* not lint */
 
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: src/usr.bin/find/main.c,v 1.23 2011/12/10 18:11:06 ed Exp $");
+
 #include <sys/types.h>
 #include <sys/stat.h>
 
@@ -76,14 +72,12 @@ int isxargs;                        /* don't permit xargs delimiting chars */
 int mindepth = -1, maxdepth = -1; /* minimum and maximum depth */
 int regexp_flags = REG_BASIC;  /* use the "basic" regexp by default*/
 
-static void usage __P((void));
+static void usage(void);
 
 int
-main(argc, argv)
-       int argc;
-       char *argv[];
+main(int argc, char *argv[])
 {
-       register char **p, **start;
+       char **p, **start;
        int Hflag, Lflag, ch;
 
        (void)setlocale(LC_ALL, "");
@@ -126,7 +120,7 @@ main(argc, argv)
                        break;
                case '?':
                default:
-                       break;
+                       usage();
                }
 
        argc -= optind;
@@ -163,9 +157,10 @@ main(argc, argv)
 }
 
 static void
-usage()
+usage(void)
 {
-       (void)fprintf(stderr,
-"usage: find [-H | -L | -P] [-EXdsx] [-f file] [file ...] [expression]\n");
+       (void)fprintf(stderr, "%s\n%s\n",
+"usage: find [-H | -L | -P] [-EXdsx] [-f path] path ... [expression]",
+"       find [-H | -L | -P] [-EXdsx] -f path [path ...] [expression]");
        exit(1);
 }