Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 May 2016 21:00:31 -0500
From:      Pedro Giffuni <pfg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r299211 - head/usr.bin/sed
Message-ID:  <6501f64e-145e-f515-8cd5-d7eca139195d@FreeBSD.org>
In-Reply-To: <201605070144.u471iMDi096965@repo.freebsd.org>
References:  <201605070144.u471iMDi096965@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help


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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6501f64e-145e-f515-8cd5-d7eca139195d>