From owner-svn-src-all@FreeBSD.ORG Wed Jul 14 22:31:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5CAF106566B; Wed, 14 Jul 2010 22:31:45 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9526F8FC08; Wed, 14 Jul 2010 22:31:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6EMVjGN099509; Wed, 14 Jul 2010 22:31:45 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6EMVjGw099507; Wed, 14 Jul 2010 22:31:45 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201007142231.o6EMVjGw099507@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 14 Jul 2010 22:31:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r210087 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jul 2010 22:31:45 -0000 Author: jilles Date: Wed Jul 14 22:31:45 2010 New Revision: 210087 URL: http://svn.freebsd.org/changeset/base/210087 Log: 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. Modified: head/bin/sh/parser.c Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Wed Jul 14 21:52:23 2010 (r210086) +++ head/bin/sh/parser.c Wed Jul 14 22:31:45 2010 (r210087) @@ -609,8 +609,7 @@ simplecmd(union node **rpp, union node * { 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 * */ 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 * 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 * 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 *