Previously it may have output too few lines.
[bug introduced in coreutils-9.8]
+ 'unexpand' no longer triggers a heap buffer overflow with --tabs arguments
+ that use the GNU extension /NUM or +NUM formats.
+ [bug introduced in coreutils-8.28]
+
** Improvements
wc -l now operates 10% faster on hosts that support AVX512 instructions.
int exit_status = EXIT_SUCCESS;
+static void
+set_max_column_width (colno width)
+{
+ if (max_column_width < width)
+ {
+ if (ckd_add (&max_column_width, width, 0))
+ error (EXIT_FAILURE, 0, _("tabs are too far apart"));
+ }
+}
/* Add tab stop TABVAL to the end of 'tab_list'. */
extern void
tab_list = xpalloc (tab_list, &n_tabs_allocated, 1, -1, sizeof *tab_list);
tab_list[first_free_tab++] = tabval;
- if (max_column_width < column_width)
- {
- if (ckd_add (&max_column_width, column_width, 0))
- error (EXIT_FAILURE, 0, _("tabs are too far apart"));
- }
+ set_max_column_width (column_width);
}
static bool
}
extend_size = tabval;
+ set_max_column_width (extend_size);
+
return ok;
}
}
increment_size = tabval;
+ set_max_column_width (increment_size);
+
return ok;
}
['blanks-12', '-t', '3,4', {IN=> "01 4\n"}, {OUT=> "01\t\t4\n"}],
['blanks-13', '-t', '3,4', {IN=> "0 4\n"}, {OUT=> "0\t\t4\n"}],
+ # These would overflow a heap buffer from v8.28 - v9.8 inclusive
+ ['blanks-ext1', '-t', '3,+6', {IN=> "\t "}, {OUT=> "\t\t"}],
+ ['blanks-ext2', '-t', '3,/9', {IN=> "\t "}, {OUT=> "\t\t"}],
+
# POSIX says spaces should only follow tabs. Also a single
# trailing space is not converted to a tab, when before
# a field starting with non blanks