From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 23:28:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AD63AB35; Sat, 22 Nov 2014 23:28:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 99FE6186; Sat, 22 Nov 2014 23:28:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAMNSg9m068519; Sat, 22 Nov 2014 23:28:42 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAMNSg9O068517; Sat, 22 Nov 2014 23:28:42 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201411222328.sAMNSg9O068517@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sat, 22 Nov 2014 23:28:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274899 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 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: Sat, 22 Nov 2014 23:28:42 -0000 Author: jilles Date: Sat Nov 22 23:28:41 2014 New Revision: 274899 URL: https://svnweb.freebsd.org/changeset/base/274899 Log: sh: Prepend "$0: " to error messages if there is no command name. Modified: head/bin/sh/error.c head/bin/sh/parser.c Modified: head/bin/sh/error.c ============================================================================== --- head/bin/sh/error.c Sat Nov 22 23:04:33 2014 (r274898) +++ head/bin/sh/error.c Sat Nov 22 23:28:41 2014 (r274899) @@ -139,6 +139,8 @@ vwarning(const char *msg, va_list ap) { if (commandname) outfmt(out2, "%s: ", commandname); + else if (arg0) + outfmt(out2, "%s: ", arg0); doformat(out2, msg, ap); out2fmt_flush("\n"); } Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Sat Nov 22 23:04:33 2014 (r274898) +++ head/bin/sh/parser.c Sat Nov 22 23:28:41 2014 (r274899) @@ -1879,6 +1879,8 @@ synerror(const char *msg) { if (commandname) outfmt(out2, "%s: %d: ", commandname, startlinno); + else if (arg0) + outfmt(out2, "%s: ", arg0); outfmt(out2, "Syntax error: %s\n", msg); error((char *)NULL); }