From owner-svn-src-head@FreeBSD.ORG Fri Oct 16 16:17:58 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26FCA1065694; Fri, 16 Oct 2009 16:17:58 +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 168848FC12; Fri, 16 Oct 2009 16:17:58 +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 n9GGHvY9008235; Fri, 16 Oct 2009 16:17:57 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9GGHvpt008234; Fri, 16 Oct 2009 16:17:57 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200910161617.n9GGHvpt008234@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 16 Oct 2009 16:17:57 +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: r198173 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Oct 2009 16:17:58 -0000 Author: jilles Date: Fri Oct 16 16:17:57 2009 New Revision: 198173 URL: http://svn.freebsd.org/changeset/base/198173 Log: sh: Show more information 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: head/bin/sh/parser.c Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Fri Oct 16 12:42:02 2009 (r198172) +++ head/bin/sh/parser.c Fri Oct 16 16:17:57 2009 (r198173) @@ -1308,11 +1308,16 @@ parsebackq: { struct jmploc *const savehandler = handler; int savelen; int saveprompt; + const int bq_startlinno = plinno; if (setjmp(jmploc.loc)) { if (str) ckfree(str); handler = savehandler; + if (exception == EXERROR) { + startlinno = bq_startlinno; + synerror("Error in command substitution"); + } longjmp(handler->loc, 1); } INTOFF;