-/* $OpenBSD: syn.c,v 1.34 2015/10/06 21:21:39 nicm Exp $ */
+/* $OpenBSD: syn.c,v 1.35 2015/10/15 22:53:50 mmcc Exp $ */
/*
* shell parser (C version)
if ((p = get_command(CONTIN)) == NULL)
syntaxerr(NULL);
if (tl == NULL)
- t = tl = block(TPIPE, t, p, NOWORDS);
+ t = tl = block(TPIPE, t, p, NULL);
else
- tl = tl->right = block(TPIPE, tl->right, p, NOWORDS);
+ tl = tl->right = block(TPIPE, tl->right, p, NULL);
}
reject = true;
}
while ((c = token(0)) == LOGAND || c == LOGOR) {
if ((p = pipeline(CONTIN)) == NULL)
syntaxerr(NULL);
- t = block(c == LOGAND? TAND: TOR, t, p, NOWORDS);
+ t = block(c == LOGAND? TAND: TOR, t, p, NULL);
}
reject = true;
}
break;
else if (c == '&' || c == COPROC)
p = block(c == '&' ? TASYNC : TCOPROC,
- p, NOBLOCK, NOWORDS);
+ p, NULL, NULL);
else if (c != ';')
have_sep = 0;
if (!t)
t = p;
else if (!tl)
- t = tl = block(TLIST, t, p, NOWORDS);
+ t = tl = block(TLIST, t, p, NULL);
else
- tl = tl->right = block(TLIST, tl->right, p, NOWORDS);
+ tl = tl->right = block(TLIST, tl->right, p, NULL);
if (!have_sep)
break;
}
t = c_list(true);
musthave(emark, KEYWORD|ALIAS);
nesting_pop(&old_nesting);
- return (block(type, t, NOBLOCK, NOWORDS));
+ return (block(type, t, NULL, NULL));
}
static struct op *
t = pipeline(0);
if (t == NULL)
syntaxerr(NULL);
- t = block(TBANG, NOBLOCK, t, NOWORDS);
+ t = block(TBANG, NULL, t, NULL);
break;
case TIME:
t->str[0] = '\0'; /* TF_* flags */
t->str[1] = '\0';
}
- t = block(TTIME, t, NOBLOCK, NOWORDS);
+ t = block(TTIME, t, NULL, NULL);
break;
case FUNCTION:
-/* $OpenBSD: tree.h,v 1.11 2015/10/06 21:19:06 nicm Exp $ */
+/* $OpenBSD: tree.h,v 1.12 2015/10/15 22:53:50 mmcc Exp $ */
/*
* command trees for compile/execute
/* $From: tree.h,v 1.3 1994/05/31 13:34:34 michael Exp $ */
-#define NOBLOCK ((struct op *)NULL)
-#define NOWORD ((char *)NULL)
-#define NOWORDS ((char **)NULL)
-
/*
* Description of a command or an operation on commands.
*/