find: insert -a in before open parens as well

This fixes expressions like -type f '(' -name foo -o -name bar ')'.
master
Michael Forney 5 months ago
parent 63271b47f7
commit 191f7e693b
  1. 3
      find.c

@ -802,7 +802,8 @@ parse(int argc, char **argv)
} else if ((op = find_op(*arg))) { /* token is an operator */
if (lasttype == LPAR && op->type == RPAR)
eprintf("empty parens\n");
if ((lasttype == PRIM || lasttype == RPAR) && op->type == NOT) { /* need another implicit -a */
if ((lasttype == PRIM || lasttype == RPAR) &&
(op->type == NOT || op->type == LPAR)) { /* need another implicit -a */
*tok++ = and;
ntok++;
}

Loading…
Cancel
Save