summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorDenys Vlasenko2019-05-13 16:29:34 +0200
committerDenys Vlasenko2019-05-13 16:30:39 +0200
commit0545bfa841540a0d7d7e2953bc205eda64144c2e (patch)
treeeff3d12359575675aefd94eca2d501fc2ebdcfbc /testsuite
parent15021f393d3d19d689028fceb5c35da930059430 (diff)
downloadbusybox-0545bfa841540a0d7d7e2953bc205eda64144c2e.zip
busybox-0545bfa841540a0d7d7e2953bc205eda64144c2e.tar.gz
sed: fix /regex/,+N match triggering only once, closes 11871
function old new delta process_files 2235 2246 +11 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/sed.tests6
1 files changed, 6 insertions, 0 deletions
diff --git a/testsuite/sed.tests b/testsuite/sed.tests
index 675cb4f..67ff87e 100755
--- a/testsuite/sed.tests
+++ b/testsuite/sed.tests
@@ -361,6 +361,12 @@ testing "sed /regex/,+N{...} addresses work" \
"" \
"1\n2\n3\n4\n5\n"
+testing "sed /regex/,+N{...} addresses work 2" \
+ "sed -n '/a/,+1 p'" \
+ "a\n1\na\n2\na\n3\n" \
+ "" \
+ "a\n1\nc\nc\na\n2\na\n3\n"
+
testing "sed /regex/,+N{...} -i works" \
"cat - >input2; sed /^4/,+2{d} -i input input2; echo \$?; cat input input2; rm input2" \
"0\n""1\n2\n3\n7\n8\n""1\n2\n7\n8\n" \