summaryrefslogtreecommitdiff
path: root/src/unexpand.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1996-07-14 22:24:28 +0000
committerJim Meyering <jim@meyering.net>1996-07-14 22:24:28 +0000
commit178f23fbb719a46f16e4426615731984e77dfb14 (patch)
treef296cd1fe5fe988693d428e51512e1638cb021df /src/unexpand.c
parent75b93231caa5ee3e56065ed61df561ef13e4e28f (diff)
downloadcoreutils-178f23fbb719a46f16e4426615731984e77dfb14.tar.xz
(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>.
Diffstat (limited to 'src/unexpand.c')
-rw-r--r--src/unexpand.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/unexpand.c b/src/unexpand.c
index 1fbda7fc8..f5c91c00d 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)