Re: [PATCH 1/6] t4061: use POSIX compliance regex(7)
- From
Jeff King <peff@peff.net>
- Date
- Mar 19, 2020, 15:53 UTC
- Message-ID
- <20200319155307.GB3513282@coredump.intra.peff.net>
- In-Reply-To
- <c45d6383173d8d3e73cdcdd6e993d3259d519a68.1584625896.git.congdanhqx@gmail.com>
On Thu, Mar 19, 2020 at 09:00:02PM +0700, Đoàn Trần Công Danh wrote:
Show 13 quoted lines
> BRE interprets `+` literally, and
> `\+` is undefined for POSIX BRE, from:
> https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_03_02
>
> > The interpretation of an ordinary character preceded
> > by an unescaped <backslash> ( '\\' ) is undefined, except for:
> > - The characters ')', '(', '{', and '}'
> > - The digits 1 to 9 inclusive
> > - A character inside a bracket expression
>
> This test is failing with busybox sed, the default sed of Alpine Linux
>
> Fix it by using literal `+` instead.This makes sense, I think. It could hurt a sed which is expected ERE and needs the "+" escaped, but I think such a sed would be wrong (and I imagine would break things elsewhere).
-Peff