svn commit: r299211 - head/usr.bin/sed

Pedro Giffuni pfg at FreeBSD.org
Sat May 7 02:28:41 UTC 2016



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.


More information about the svn-src-all mailing list