bb sed 'N' broken

Timo Teras timo.teras at iki.fi
Fri Jul 19 06:02:23 UTC 2013


Hi,

I "accidentally" noticed that some sed scripts perl configure does take
a long time with bb sed, but works fast with gnu sed. So I tracked the
issue down.

Basically:
sed -n -e ': testcont; /\\$/{ =; N; b testcont }'

With the input:
--cut--
this is a regular line

and line with \
continuations 

more regular lines

--cut--

I expect to only get one output, '3' which the line number of the line
having the trailing '\' that should match. And this is what I indeed
get with GNU sed.

With bb sed I get:
3
4
5
6
7
8

So somehow 'N' command is broken and it causes all future end-of-line
matches to succeed.

- Timo


More information about the busybox mailing list