summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2010-12-30 01:36:59 +0000
committerPádraig Brady <P@draigBrady.com>2010-12-30 16:26:20 +0000
commit44dbcae6b98700617d4d3cb8d799ce83d538e3e7 (patch)
treeffeea8e1488a96e5d3baa713d2b29e9afa3c0566 /tests
parentb0097f3d2180352896a4434fb8eaeb076f12794c (diff)
downloadcoreutils-44dbcae6b98700617d4d3cb8d799ce83d538e3e7.tar.xz
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
Diffstat (limited to 'tests')
-rwxr-xr-xtests/misc/split-a10
1 files changed, 10 insertions, 0 deletions
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