summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorAaro Koskinen2016-11-22 00:19:51 +0200
committerDenys Vlasenko2016-11-24 11:40:36 +0100
commitcb810c48c036f50c19b08df7e161cdb0550a2abd (patch)
treefe18bf724cb5c53ae9861e778bbf6db1bce712f6 /testsuite
parent2eff59667d3c590f27ee39cd0969b2221af739a0 (diff)
downloadbusybox-cb810c48c036f50c19b08df7e161cdb0550a2abd.zip
busybox-cb810c48c036f50c19b08df7e161cdb0550a2abd.tar.gz
patch: fix matching failure
Fix matching failure when plist is advanced while checking for buffered lines - the lines in the hunk that are about to be added should be skipped when checking for matching context. Also add a valid test case that fails with current busybox and is fixed by the change. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/patch.tests45
1 files changed, 45 insertions, 0 deletions
diff --git a/testsuite/patch.tests b/testsuite/patch.tests
index 2759d2a..3920524 100755
--- a/testsuite/patch.tests
+++ b/testsuite/patch.tests
@@ -242,6 +242,51 @@ patch: can't open 'dir2///file': No such file or directory
zxc
"
+testing "patch internal buffering bug?" \
+ 'patch -p1 2>&1; echo $?; cat input' \
+"\
+patching file input
+0
+foo
+
+
+
+
+
+
+1
+2
+3
+
+bar
+" \
+"\
+foo
+
+
+
+
+
+
+
+bar
+" \
+"\
+--- a/input.orig
++++ b/input
+@@ -5,5 +5,8 @@ foo
+
+
+
++1
++2
++3
+
+ bar
+--
+2.9.2
+" \
+
rm input.orig 2>/dev/null
exit $FAILCOUNT