summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2010-07-14 22:31:45 +0000
committerjilles <jilles@FreeBSD.org>2010-07-14 22:31:45 +0000
commit7e0d773037f6c4f0fbea1013f4104552d7c73fd3 (patch)
tree001cd64d43a3320883aed1a9788c4acb1151b394 /bin
parent4c3701762050329e2f975f7a152d24c6a664ac96 (diff)
downloadFreeBSD-src-7e0d773037f6c4f0fbea1013f4104552d7c73fd3.zip
FreeBSD-src-7e0d773037f6c4f0fbea1013f4104552d7c73fd3.tar.gz
sh: There cannot be a TNOT in simplecmd(), remove checks.
simplecmd() only handles simple commands and function definitions, neither of which involves the ! keyword. The initial token on entry to simplecmd() is one of the following: TSEMI, TAND, TOR, TNL, TEOF, TWORD, TRP.
Diffstat (limited to 'bin')
-rw-r--r--bin/sh/parser.c22
1 files changed, 3 insertions, 19 deletions
diff --git a/bin/sh/parser.c b/bin/sh/parser.c
index 7f7f0d6..e55332e 100644
--- a/bin/sh/parser.c
+++ b/bin/sh/parser.c
@@ -609,8 +609,7 @@ simplecmd(union node **rpp, union node *redir)
{
union node *args, **app;
union node **orig_rpp = rpp;
- union node *n = NULL, *n2;
- int negate = 0;
+ union node *n = NULL;
/* If we don't have any redirections already, then we must reset */
/* rpp to be the address of the local redir variable. */
@@ -626,12 +625,6 @@ simplecmd(union node **rpp, union node *redir)
*/
orig_rpp = rpp;
- while (readtoken() == TNOT) {
- TRACE(("command: TNOT recognized\n"));
- negate = !negate;
- }
- tokpushback++;
-
for (;;) {
if (readtoken() == TWORD) {
n = (union node *)stalloc(sizeof (struct narg));
@@ -657,7 +650,7 @@ simplecmd(union node **rpp, union node *redir)
n->type = NDEFUN;
n->narg.next = command();
funclinno = 0;
- goto checkneg;
+ return n;
} else {
tokpushback++;
break;
@@ -670,16 +663,7 @@ simplecmd(union node **rpp, union node *redir)
n->ncmd.backgnd = 0;
n->ncmd.args = args;
n->ncmd.redirect = redir;
-
-checkneg:
- if (negate) {
- n2 = (union node *)stalloc(sizeof (struct nnot));
- n2->type = NNOT;
- n2->nnot.com = n;
- return n2;
- }
- else
- return n;
+ return n;
}
STATIC union node *
OpenPOWER on IntegriCloud