diff options
author | Jim Meyering <jim@meyering.net> | 1993-03-22 04:39:25 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1993-03-22 04:39:25 +0000 |
commit | 45849c56020d56a3790e0ddea176e5cb94d29323 (patch) | |
tree | 9773620138bd0a8ca028614001c6a914b2fcfae3 /src/pr.c | |
parent | b1770970a889eb6dcd3315973165fc14a4abffd9 (diff) | |
download | coreutils-45849c56020d56a3790e0ddea176e5cb94d29323.tar.xz |
(close_file): Reverse May 13, '92 change, but add the condition
that cols_ready_to_print not be decremented when printing across.
The command `echo |pr -2ta' didn't terminate.
(print_page): Rewrite conditional with side effects in second conjunct
using nested if statements to make it clear that we do indeed want
those semantics.
Diffstat (limited to 'src/pr.c')
-rw-r--r-- | src/pr.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -919,10 +919,8 @@ close_file (p) q->status = CLOSED; if (q->lines_stored == 0) { -#if 0 - if (cols_ready_to_print > 0) + if (cols_ready_to_print > 0 && !print_across_flag) --cols_ready_to_print; -#endif q->lines_to_print = 0; } } @@ -1180,8 +1178,13 @@ print_page () if (use_column_separator) ++separators_not_printed; - if (--p->lines_to_print <= 0 && --cols_ready_to_print <= 0) - break; + --p->lines_to_print; + if (p->lines_to_print <= 0) + { + --cols_ready_to_print; + if (cols_ready_to_print <= 0) + break; + } } } |