From owner-svn-src-head@FreeBSD.ORG Fri Oct 3 20:24:58 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 2F3D279B; Fri, 3 Oct 2014 20:24:58 +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 01C6EF9; Fri, 3 Oct 2014 20:24:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s93KOvvZ070725; Fri, 3 Oct 2014 20:24:57 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s93KOveM070721; Fri, 3 Oct 2014 20:24:57 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201410032024.s93KOveM070721@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Fri, 3 Oct 2014 20:24:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272482 - in head/bin/sh: . tests/builtins 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: Fri, 03 Oct 2014 20:24:58 -0000 Author: jilles Date: Fri Oct 3 20:24:56 2014 New Revision: 272482 URL: https://svnweb.freebsd.org/changeset/base/272482 Log: sh: Fix LINENO and prompt after $'\0 and newline. Added: head/bin/sh/tests/builtins/lineno3.0 (contents, props changed) head/bin/sh/tests/builtins/lineno3.0.stdout (contents, props changed) Modified: head/bin/sh/parser.c head/bin/sh/tests/builtins/Makefile Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Fri Oct 3 17:27:30 2014 (r272481) +++ head/bin/sh/parser.c Fri Oct 3 20:24:56 2014 (r272482) @@ -1279,6 +1279,13 @@ readcstyleesc(char *out) c = pgetc(); if (c == PEOF) synerror("Unterminated quoted string"); + if (c == '\n') { + plinno++; + if (doprompt) + setprompt(2); + else + setprompt(0); + } } pungetc(); return out; Modified: head/bin/sh/tests/builtins/Makefile ============================================================================== --- head/bin/sh/tests/builtins/Makefile Fri Oct 3 17:27:30 2014 (r272481) +++ head/bin/sh/tests/builtins/Makefile Fri Oct 3 20:24:56 2014 (r272482) @@ -100,6 +100,7 @@ FILES+= jobid2.0 FILES+= kill1.0 kill2.0 FILES+= lineno.0 lineno.0.stdout FILES+= lineno2.0 +FILES+= lineno3.0 lineno3.0.stdout FILES+= local1.0 FILES+= local2.0 FILES+= local3.0 Added: head/bin/sh/tests/builtins/lineno3.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/builtins/lineno3.0 Fri Oct 3 20:24:56 2014 (r272482) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +echo before: $LINENO +dummy=$'a\0 +' +echo after: $LINENO Added: head/bin/sh/tests/builtins/lineno3.0.stdout ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/builtins/lineno3.0.stdout Fri Oct 3 20:24:56 2014 (r272482) @@ -0,0 +1,2 @@ +before: 3 +after: 6