diff options
author | Jim Meyering <jim@meyering.net> | 1996-07-14 22:24:28 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1996-07-14 22:24:28 +0000 |
commit | 178f23fbb719a46f16e4426615731984e77dfb14 (patch) | |
tree | f296cd1fe5fe988693d428e51512e1638cb021df /src | |
parent | 75b93231caa5ee3e56065ed61df561ef13e4e28f (diff) | |
download | coreutils-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')
-rw-r--r-- | src/unexpand.c | 6 |
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) |