From 44dbcae6b98700617d4d3cb8d799ce83d538e3e7 Mon Sep 17 00:00:00 2001 From: Pádraig Brady Date: Thu, 30 Dec 2010 01:36:59 +0000 Subject: split: fix the suffix length calculation * src/split.c (set_suffix_length): Only auto-calculate the suffix length when the number of files is specified. * tests/misc/split-a: Add a case to trigger the bug, and exercise the suffix length auto-calculation. * NEWS: Mention the fix. Reported by Dmitry V. Levin and Sergey Vlasov at https://bugzilla.altlinux.org/show_bug.cgi?id=24841 --- tests/misc/split-a | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests') diff --git a/tests/misc/split-a b/tests/misc/split-a index d861b9291..08d313efd 100755 --- a/tests/misc/split-a +++ b/tests/misc/split-a @@ -63,4 +63,14 @@ for f in $files; do n=$(expr $n + 1) done +# Ensure that -a is independent of -[bCl] +split -a2 -b1000 < /dev/null || fail=1 +split -a2 -l1000 < /dev/null || fail=1 +split -a2 -C1000 < /dev/null || fail=1 + +# Ensure that -a fails early with a -n that is too large +rm -f x* +split -a2 -n1000 < /dev/null && fail=1 +test -f xaa && fail=1 + Exit $fail -- cgit v1.2.3-54-g00ecf