-a wasn't getting discarded completely; test case is:
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Mon, 2 Jul 1990 08:09:52 +0000 (00:09 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Mon, 2 Jul 1990 08:09:52 +0000 (00:09 -0800)
find /tmp '(' -fstype local -o -prune ')' -a -print

SCCS-vsn: usr.bin/find/find.c 4.32
SCCS-vsn: usr.bin/find/option.c 5.3

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

index 69d7b2c..3e5e6c7 100644 (file)
@@ -15,7 +15,7 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)find.c     4.31 (Berkeley) %G%";
+static char sccsid[] = "@(#)find.c     4.32 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -104,7 +104,8 @@ find_formplan(argv)
         * plan->next pointer.
         */
        for (plan = NULL; *argv;) {
         * plan->next pointer.
         */
        for (plan = NULL; *argv;) {
-               new = find_create(&argv);
+               if (!(new = find_create(&argv)))
+                       continue;
                if (plan == NULL)
                        tail = plan = new;
                else {
                if (plan == NULL)
                        tail = plan = new;
                else {
index 376d970..fea1d28 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)option.c   5.2 (Berkeley) %G%";
+static char sccsid[] = "@(#)option.c   5.3 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -43,8 +43,8 @@ OPTION options[] = {
        "!",            T_NOT,          c_not,          O_ZERO,
        "(",            T_OPENPAREN,    c_openparen,    O_ZERO,
        ")",            T_CLOSEPAREN,   c_closeparen,   O_ZERO,
        "!",            T_NOT,          c_not,          O_ZERO,
        "(",            T_OPENPAREN,    c_openparen,    O_ZERO,
        ")",            T_CLOSEPAREN,   c_closeparen,   O_ZERO,
-       "a",            T_AND,          (PLAN *(*)())-1,O_NONE|O_OLD,
-       "and",          T_AND,          (PLAN *(*)())-1,O_NONE|O_NEW,
+       "a",            T_AND,          NULL,           O_NONE|O_OLD,
+       "and",          T_AND,          NULL,           O_NONE|O_NEW,
        "atime",        T_ATIME,        c_atime,        O_ARGV,
        "ctime",        T_CTIME,        c_ctime,        O_ARGV,
        "depth",        T_DEPTH,        c_depth,        O_ZERO|O_OLD,
        "atime",        T_ATIME,        c_atime,        O_ARGV,
        "ctime",        T_CTIME,        c_ctime,        O_ARGV,
        "depth",        T_DEPTH,        c_depth,        O_ZERO|O_OLD,
@@ -113,6 +113,9 @@ find_create(argvp)
        }
 
        switch(p->flags&O_MASK) {
        }
 
        switch(p->flags&O_MASK) {
+       case O_NONE:
+               new = NULL;
+               break;
        case O_ZERO:
                new = (p->create)();
                break;
        case O_ZERO:
                new = (p->create)();
                break;