summaryrefslogtreecommitdiffstats
path: root/text-utils/col.c
diff options
context:
space:
mode:
Diffstat (limited to 'text-utils/col.c')
-rw-r--r--text-utils/col.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/text-utils/col.c b/text-utils/col.c
index b236b891f..bac48e7e3 100644
--- a/text-utils/col.c
+++ b/text-utils/col.c
@@ -391,6 +391,8 @@ int main(int argc, char **argv)
/* goto the last line that had a character on it */
for (; l->l_next; l = l->l_next)
this_line++;
+ if (max_line == 0)
+ return EXIT_SUCCESS; /* no lines, so just exit */
flush_lines(this_line - nflushd_lines + extra_lines + 1);
/* make sure we leave things in a sane state */