Add test to detect this.
authorJim Meyering <jim@meyering.net>
Sun, 16 Nov 2003 11:52:08 +0000 (11:52 +0000)
committerJim Meyering <jim@meyering.net>
Sun, 16 Nov 2003 11:52:08 +0000 (11:52 +0000)
This would fail due to reading from freed buffer with coreutils-5.0.91.

tests/misc/csplit

index b0cb1fa..2d04fee 100755 (executable)
@@ -36,6 +36,14 @@ cmp out exp || fail=1
 test $fail = 1 && diff out exp 2> /dev/null
 rm -f in out exp
 
+# Ensure that xx02 contains just two newlines.
+# This would fail due to reading from freed buffer with coreutils-5.0.91.
+printf '\n\n' > exp
+cp xx02 out || fail=1
+cmp out exp || fail=1
+test $fail = 1 && diff out exp 2> /dev/null
+rm -f in out exp
+
 # csplit would infloop
 (echo; echo a) > in
 csplit in '/a/-1' '{*}' > out || fail=1