From owner-svn-src-head@freebsd.org Sun Jul 31 05:31:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9821BA9279; Sun, 31 Jul 2016 05:31:10 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 8B3A81D71; Sun, 31 Jul 2016 05:31:10 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6V5V9pU093026; Sun, 31 Jul 2016 05:31:09 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6V5V9U0093025; Sun, 31 Jul 2016 05:31:09 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201607310531.u6V5V9U0093025@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 31 Jul 2016 05:31:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303572 - head/usr.bin/sed 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.22 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: Sun, 31 Jul 2016 05:31:10 -0000 Author: ngie Date: Sun Jul 31 05:31:09 2016 New Revision: 303572 URL: https://svnweb.freebsd.org/changeset/base/303572 Log: Fix regression with /i caused by r303047 '\n' was specifically added to -e arguments prior to r303047. Restore historical behavior which in turn fixes usr.sbin/etcupdate/preworld_test:main . The fix is being committed to address the issue in the short term and may be iterated upon as noted in bug 211399 Discussed with: mi, pfg Differential Revision: https://reviews.freebsd.org/D7368 PR: 195929, 211399 [*] MFC after: 18 days X-MFC with: r303047 Reported by: Jenkins Sponsored by: EMC / Isilon Storage Division Modified: head/usr.bin/sed/main.c Modified: head/usr.bin/sed/main.c ============================================================================== --- head/usr.bin/sed/main.c Sun Jul 31 04:58:06 2016 (r303571) +++ head/usr.bin/sed/main.c Sun Jul 31 05:31:09 2016 (r303572) @@ -123,6 +123,7 @@ static void usage(void); int main(int argc, char *argv[]) { + char *temp_arg; int c, fflag; (void) setlocale(LC_ALL, ""); @@ -145,7 +146,10 @@ main(int argc, char *argv[]) break; case 'e': eflag = 1; - add_compunit(CU_STRING, optarg); + asprintf(&temp_arg, "%s\n", optarg); + if (temp_arg == NULL) + errx(1, "Couldn't allocate temporary buffer"); + add_compunit(CU_STRING, temp_arg); break; case 'f': fflag = 1;