summaryrefslogtreecommitdiff
path: root/src/pr.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1993-03-22 04:39:25 +0000
committerJim Meyering <jim@meyering.net>1993-03-22 04:39:25 +0000
commit45849c56020d56a3790e0ddea176e5cb94d29323 (patch)
tree9773620138bd0a8ca028614001c6a914b2fcfae3 /src/pr.c
parentb1770970a889eb6dcd3315973165fc14a4abffd9 (diff)
downloadcoreutils-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.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/pr.c b/src/pr.c
index 1abb686bb..bf4517d2a 100644
--- a/src/pr.c
+++ b/src/pr.c
@@ -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;
+ }
}
}