summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2005-09-10 14:06:29 +0000
committerJim Meyering <jim@meyering.net>2005-09-10 14:06:29 +0000
commit5c2d34512114ad76b5a6934cd22f3f577509b65a (patch)
tree80cb67f14ec84c8b905653252b6863e9b5ce2239
parent0fca40dd6cd9e5e2e9348fbab6c97bf40ccd33dc (diff)
downloadcoreutils-5c2d34512114ad76b5a6934cd22f3f577509b65a.tar.xz
Add test for the bug fixed today.
-rwxr-xr-xtests/misc/csplit9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/misc/csplit b/tests/misc/csplit
index 5ea8a6aef..740df9e2e 100755
--- a/tests/misc/csplit
+++ b/tests/misc/csplit
@@ -86,4 +86,13 @@ EOF
cmp err experr || fail=1
test $fail = 1 && diff err experr 2> /dev/null
+# Ensure that lines longer than the initial buffer length don't cause
+# trouble (e.g. reading from freed memory, resulting in corrupt output).
+# This test failed at least in coreutils-5.2.1 and 5.3.0, and was fixed
+# in 5.3.1.
+rm -f in out exp err experr xx??
+printf 'x%8199s\nx\n%8199s\nx\n' x x > in
+csplit in '/x/' '{*}' > /dev/null || fail=1
+cat xx?? | cmp - in || fail=1
+
(exit $fail); exit $fail