From owner-svn-src-all@FreeBSD.ORG Sun Jan 13 19:26:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7E86D658; Sun, 13 Jan 2013 19:26:34 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6EE8675A; Sun, 13 Jan 2013 19:26:34 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0DJQXj4064112; Sun, 13 Jan 2013 19:26:33 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0DJQXQS064110; Sun, 13 Jan 2013 19:26:33 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201301131926.r0DJQXQS064110@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 13 Jan 2013 19:26:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245382 - in head: bin/sh tools/regression/bin/sh/parser X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 13 Jan 2013 19:26:34 -0000 Author: jilles Date: Sun Jan 13 19:26:33 2013 New Revision: 245382 URL: http://svnweb.freebsd.org/changeset/base/245382 Log: sh: Fix crash when parsing '{ } &'. MFC after: 1 week Added: head/tools/regression/bin/sh/parser/empty-braces1.0 (contents, props changed) Modified: head/bin/sh/parser.c Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Sun Jan 13 19:19:40 2013 (r245381) +++ head/bin/sh/parser.c Sun Jan 13 19:26:33 2013 (r245382) @@ -240,9 +240,9 @@ list(int nlflag, int erflag) n2 = andor(); tok = readtoken(); if (tok == TBACKGND) { - if (n2->type == NPIPE) { + if (n2 != NULL && n2->type == NPIPE) { n2->npipe.backgnd = 1; - } else if (n2->type == NREDIR) { + } else if (n2 != NULL && n2->type == NREDIR) { n2->type = NBACKGND; } else { n3 = (union node *)stalloc(sizeof (struct nredir)); Added: head/tools/regression/bin/sh/parser/empty-braces1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/parser/empty-braces1.0 Sun Jan 13 19:26:33 2013 (r245382) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +# Unfortunately, some scripts depend on the extension of allowing an empty +# pair of braces. + +{ } & +wait $!