From 178f23fbb719a46f16e4426615731984e77dfb14 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sun, 14 Jul 1996 22:24:28 +0000 Subject: [PATCH] (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 . --- src/unexpand.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/unexpand.c b/src/unexpand.c index 1fbda7fc8e..f5c91c00d5 100644 --- a/src/unexpand.c +++ b/src/unexpand.c @@ -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) -- 2.47.2