From owner-svn-src-all@freebsd.org Sat May 7 02:28:41 2016 Return-Path: Delivered-To: svn-src-all@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 1FBE9B2E11F for ; Sat, 7 May 2016 02:28:41 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm21.bullet.mail.bf1.yahoo.com (nm21.bullet.mail.bf1.yahoo.com [98.139.212.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD4A716CD for ; Sat, 7 May 2016 02:28:40 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1462586421; bh=Rd1vObGXpEjXNA+VHkR0BiRo9DVDBBRBHwrUYNMfGtY=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=NKcjMaRwt2UzGmiAo9VyY8VQFfVUTnkDYCD1Dqo3v3P8EnplK34RXoozPKSSA4k/oMu4s3Ps3BloH793mTwFb1if1KtE/3tZIdJ9flf0GeQr0M61AanDiL8+beuWWvh01KFeGTDJk99/RAQZ5rB2QwSN+/S24Xbw1Hl6psXQMsNStPSut/6KTfI6enSuYF9NjY07mj7VQaJsEDb9ULWe0UmCFmdxU3sb+1SqqVoV6394CZAo1mGOIfx2Dk9yt7WdpjIV2C9Puahib/QAQK81PNStxzfpbADDMa22++h9bY30r88DTu6cpaWyPu1QMS4S8oS2lVjRTPh/H3rWunCRJg== Received: from [66.196.81.174] by nm21.bullet.mail.bf1.yahoo.com with NNFMP; 07 May 2016 02:00:21 -0000 Received: from [98.139.211.194] by tm20.bullet.mail.bf1.yahoo.com with NNFMP; 07 May 2016 02:00:21 -0000 Received: from [127.0.0.1] by smtp203.mail.bf1.yahoo.com with NNFMP; 07 May 2016 02:00:21 -0000 X-Yahoo-Newman-Id: 268771.56365.bm@smtp203.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: wBZtvPMVM1m0NiQ1tPG8CXFLLjBcpSXJVE6iAMrHWxq7Wai zk7xvtZgPvMPvu7_RYOctA8ANuZX8wMZ9TyxM0Z3ctMmqid1I9YAS4IRJtMi kKaGxkdkL62B83xUcObrOH04MR_7d_Ov23bON5npkXxRclfqWcZXnWzXwhLx QTo1UA5ryZ_07Rd22YlCMmKx_VW_DvG6.NT1LTF7w1QDD1T9Fve9UoTd7e.F K5NRbJ_VC3bL_cMwkY4_MHZLv0IpqLo2y80BxW5EOMuLNowBAqfZFBk5HN.x fiHQFqPzAr89XciWyKnADMwXES1Xa1v9sy0iB3kQnB6_1PfyeGNSad4PDlvA 7_FHEdWyxsWkfnJUmOo_y1zg0zSELaTiAJLBmmoIp1PCtc1rtVf5ZgTpu1aN OSNOTUA2Y3F639NM7aw6debmUfiit98LnOFTiP.pKiH5uIfX9Uc8OkJvZT2P Xu7PKXLZydeo5D6ftP6P4TD._K7w3PcmsVjmk6VQxnKac8h10By5_OBu.phz DGYSorw9skkp.JbN9NFV4PKd9GhM4ssom X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r299211 - head/usr.bin/sed To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201605070144.u471iMDi096965@repo.freebsd.org> From: Pedro Giffuni Message-ID: <6501f64e-145e-f515-8cd5-d7eca139195d@FreeBSD.org> Date: Fri, 6 May 2016 21:00:31 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <201605070144.u471iMDi096965@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2016 02:28:41 -0000 On 05/06/16 20:44, Pedro F. Giffuni wrote: > Author: pfg > Date: Sat May 7 01:44:22 2016 > New Revision: 299211 > URL: https://svnweb.freebsd.org/changeset/base/299211 > > Log: > sed: rewrite the main loop. > > Rewrite the main loop of the "sed s/..." command, shortening it by ten > lines and simplifying it by removing the switch statement implementing > /g, /1, and /2 separately and repetitively. > > This will be needed to bring a fix from OpenBSD later. > For the curious, from PR 209352. $ echo a,a,a,a,a | sed -r 's/\<.,/X&/g' Xa,a,Xa,a,a $ echo a,a,a,a,a | gsed -r 's/\<.,/X&/g' Xa,Xa,Xa,Xa,a Cheers, Pedro.