make status variables consistent
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Fri, 16 Nov 1990 04:22:50 +0000 (20:22 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Fri, 16 Nov 1990 04:22:50 +0000 (20:22 -0800)
SCCS-vsn: usr.bin/find/main.c 5.5
SCCS-vsn: usr.bin/find/misc.c 5.4
SCCS-vsn: usr.bin/find/option.c 5.4

usr/src/usr.bin/find/main.c
usr/src/usr.bin/find/misc.c
usr/src/usr.bin/find/option.c

index 48d7ed5..f6644dd 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)main.c     5.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)main.c     5.5 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -15,15 +15,13 @@ static char sccsid[] = "@(#)main.c  5.4 (Berkeley) %G%";
 #include <fts.h>
 #include "find.h"
 
 #include <fts.h>
 #include "find.h"
 
-int relative;
-
 void
 newsyntax(argc, argvp)
        int argc;
        char ***argvp;
 {
 void
 newsyntax(argc, argvp)
        int argc;
        char ***argvp;
 {
+       extern int optind;
        extern char *optarg;
        extern char *optarg;
-       extern int depth, optind;
        int ch;
        char **argv, **cur;
 
        int ch;
        char **argv, **cur;
 
@@ -31,13 +29,13 @@ newsyntax(argc, argvp)
        while ((ch = getopt(argc, argv, "df:rsx")) != EOF)
                switch(ch) {
                case 'd':
        while ((ch = getopt(argc, argv, "df:rsx")) != EOF)
                switch(ch) {
                case 'd':
-                       depth = 1;
+                       isdepth = 1;
                        break;
                case 'f':
                        *cur++ = optarg;
                        break;
                case 'r':
                        break;
                case 'f':
                        *cur++ = optarg;
                        break;
                case 'r':
-                       relative = 1;
+                       isrelative = 1;
                        break;
                case 's':
                        ftsoptions &= ~FTS_PHYSICAL;
                        break;
                case 's':
                        ftsoptions &= ~FTS_PHYSICAL;
index c3b3039..1aecc7a 100644 (file)
@@ -9,11 +9,12 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)misc.c     5.3 (Berkeley) %G%";
+static char sccsid[] = "@(#)misc.c     5.4 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #include <sys/stat.h>
 #endif /* not lint */
 
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <sys/errno.h>
 #include <stdio.h>
 #include "find.h"
  
 #include <stdio.h>
 #include "find.h"
  
@@ -95,9 +96,7 @@ emalloc(len)
 
 usage()
 {
 
 usage()
 {
-       extern int deprecated;
-
-       if (deprecated)
+       if (isdeprecated)
                (void)fprintf(stderr, "usage: find path-list expression\n");
        else
                (void)fprintf(stderr,
                (void)fprintf(stderr, "usage: find path-list expression\n");
        else
                (void)fprintf(stderr,
index fea1d28..a09a509 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)option.c   5.3 (Berkeley) %G%";
+static char sccsid[] = "@(#)option.c   5.4 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -85,7 +85,6 @@ PLAN *
 find_create(argvp)
        char ***argvp;
 {
 find_create(argvp)
        char ***argvp;
 {
-       extern int deprecated;
        register OPTION *p;
        OPTION tmp;
        PLAN *new;
        register OPTION *p;
        OPTION tmp;
        PLAN *new;
@@ -101,8 +100,8 @@ find_create(argvp)
 
        p = (OPTION *)bsearch(&tmp, options, sizeof(options)/sizeof(OPTION),
            sizeof(OPTION), typecompare);
 
        p = (OPTION *)bsearch(&tmp, options, sizeof(options)/sizeof(OPTION),
            sizeof(OPTION), typecompare);
-       if (!p || deprecated && p->flags&O_NEW ||
-           !deprecated && p->flags&O_OLD) {
+       if (!p || isdeprecated && p->flags&O_NEW ||
+           !isdeprecated && p->flags&O_OLD) {
                (void)fprintf(stderr, "find: unknown option %s.\n", *--argv);
                exit(1);
        }
                (void)fprintf(stderr, "find: unknown option %s.\n", *--argv);
                exit(1);
        }