(like Solaris 10 and Solaris 11).
[bug introduced in coreutils-8.31]
+ split no longer reports a "output file suffixes exhausted" error
+ when the specified number of files is evenly divisible by 10, 16, 26,
+ for --numeric, --hex, or default alphabetic suffixes respectively.
+ [bug introduced in coreutils-8.24]
+
* Noteworthy changes in release 8.31 (2019-03-10) [stable]
Joey Hess joeyh@debian.org
Johan Boule bohan@bohan.dyndns.org
Johan Danielsson joda@pdc.kth.se
+Johannes Altmanninger aclopte@gmail.com
John Bley jbb6@acpub.duke.edu
John Gatewood Ham zappaman@alphabox.compsci.buu.ac.th
John Gotts jgotts@umich.edu
{
#define DEFAULT_SUFFIX_LENGTH 2
- uintmax_t suffix_needed = 0;
+ uintmax_t suffix_length_needed = 0;
/* The suffix auto length feature is incompatible with
a user specified start value as the generated suffixes
if (split_type == type_chunk_bytes || split_type == type_chunk_lines
|| split_type == type_rr)
{
- uintmax_t n_units_end = n_units;
+ uintmax_t n_units_end = n_units - 1;
if (numeric_suffix_start)
{
uintmax_t n_start;
}
size_t alphabet_len = strlen (suffix_alphabet);
- bool alphabet_slop = (n_units_end % alphabet_len) != 0;
- while (n_units_end /= alphabet_len)
- suffix_needed++;
- suffix_needed += alphabet_slop;
+ do
+ suffix_length_needed++;
+ while (n_units_end /= alphabet_len);
+
suffix_auto = false;
}
if (suffix_length) /* set by user */
{
- if (suffix_length < suffix_needed)
+ if (suffix_length < suffix_length_needed)
{
die (EXIT_FAILURE, 0,
_("the suffix length needs to be at least %"PRIuMAX),
- suffix_needed);
+ suffix_length_needed);
}
suffix_auto = false;
return;
}
else
- suffix_length = MAX (DEFAULT_SUFFIX_LENGTH, suffix_needed);
+ suffix_length = MAX (DEFAULT_SUFFIX_LENGTH, suffix_length_needed);
}
void
# as that would result in an incorrect order for the total output file set
returns_ 1 split --numeric-suffixes=100 --number=r/100 file.in || fail=1
+# coreutils v8.24 - v8.31 inclusive would incorrectly auto calculate
+# a suffix length that was too small, when the number of files was
+# evenly divisible by the suffix base (10,16,26).
+truncate -s0 file.in || framework_failure_
+split --numeric-suffixes --number=110 file.in || fail=1
+
Exit $fail