From owner-svn-src-stable@FreeBSD.ORG Sun Dec 20 20:51:20 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5BC4D106566C; Sun, 20 Dec 2009 20:51:20 +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 4A4218FC14; Sun, 20 Dec 2009 20:51:20 +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 nBKKpKK7074657; Sun, 20 Dec 2009 20:51:20 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBKKpKEv074655; Sun, 20 Dec 2009 20:51:20 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200912202051.nBKKpKEv074655@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 20 Dec 2009 20:51:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200760 - stable/8/bin/sh X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2009 20:51:20 -0000 Author: jilles Date: Sun Dec 20 20:51:20 2009 New Revision: 200760 URL: http://svn.freebsd.org/changeset/base/200760 Log: MFC r198173: sh: show more info about syntax errors in command substitution: the line number where the command substitution started. This applies to both the $() and `` forms but is most useful for `` because the other line number is relative to the enclosed text there. (For older versions, -v can be used as a workaround.) Modified: stable/8/bin/sh/parser.c Directory Properties: stable/8/bin/sh/ (props changed) Modified: stable/8/bin/sh/parser.c ============================================================================== --- stable/8/bin/sh/parser.c Sun Dec 20 19:45:46 2009 (r200759) +++ stable/8/bin/sh/parser.c Sun Dec 20 20:51:20 2009 (r200760) @@ -1310,6 +1310,7 @@ parsebackq: { struct jmploc *const savehandler = handler; int savelen; int saveprompt; + const int bq_startlinno = plinno; savepbq = parsebackquote; if (setjmp(jmploc.loc)) { @@ -1317,6 +1318,10 @@ parsebackq: { ckfree(str); parsebackquote = 0; handler = savehandler; + if (exception == EXERROR) { + startlinno = bq_startlinno; + synerror("Error in command substitution"); + } longjmp(handler->loc, 1); } INTOFF;