mirror of
git://git.sv.gnu.org/coreutils.git
synced 2026-04-20 18:56:39 +02:00
(unexpand): Fix bug that contributed to endless loop
when invoking `echo ' ' |unexpand -t 1,2': use print_tab_index, not tab_index in inner flush_pend: while loop. From Keith Owens <kaos@audio.apana.org.au>.
This commit is contained in:
@@ -290,10 +290,10 @@ unexpand (void)
|
||||
{
|
||||
if (tab_size == 0)
|
||||
{
|
||||
/* Do not let tab_index == first_free_tab;
|
||||
/* Do not let print_tab_index == first_free_tab;
|
||||
stop when it is 1 less. */
|
||||
while (tab_index < first_free_tab - 1
|
||||
&& column >= tab_list[tab_index])
|
||||
while (print_tab_index < first_free_tab - 1
|
||||
&& column >= tab_list[print_tab_index])
|
||||
print_tab_index++;
|
||||
next_tab_column = tab_list[print_tab_index];
|
||||
if (print_tab_index < first_free_tab - 1)
|
||||
|
||||
Reference in New Issue
Block a user