#1029220 coreutils: csplit: expr with lookbehind loses lines vs equivalent no-offset construct

Package:
coreutils
Source:
coreutils
Description:
GNU core utilities
Submitter:
наб
Date:
2023-01-19 22:21:08 UTC
Severity:
normal
#1029220#5
Date:
2023-01-19 21:49:56 UTC
From:
To:
Dear Maintainer,

I've extracted the following from a break-down
I've been having for the past three hours (annotated):
-- >8 --
$ seq 90 110 | cat -n
     1	90     xx00
     2	91
     3	92
     4	93
     5	94
     6	95     xx01
     7	96
     8	97
     9	98
    10	99
    11	100    xx02
    12	101
    13	102
    14	103
    15	104
    16	105
    17	106
    18	107
    19	108
    20	109
    21	110
-- >8 --

For the presented input, both of the following constructs are equivalent:
  csplit - /10/-5 %10%
  csplit - /95/   %10%

And yet:
-- >8 --
$ rm xx*; seq 90 110  | csplit - /10/-5 %10%; head -n9999 xx0*
15
40
==> xx00 <==
90
91
92
93
94

==> xx01 <==
101
102
103
104
105
106
107
108
109
110
$ rm xx*; seq 90 110  | csplit - /95/ %10%; head -n9999 xx0*
15
44
==> xx00 <==
90
91
92
93
94

==> xx01 <==
100
101
102
103
104
105
106
107
108
109
110
-- >8 --

Additionally to the triviality of this observation,
NetBSD agrees with my assessment.

Best,
наб

#1029220#10
Date:
2023-01-19 22:17:09 UTC
From:
To:
For reference, and I don't know if this is the same bug or just related,
but here's the original bug I ran into: