aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/col/col.c
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>1997-03-11 13:43:33 +0000
committerPeter Wemm <peter@FreeBSD.org>1997-03-11 13:43:33 +0000
commitdf3f5d9dd51fa82a604ec559a75d3791a7b80ed5 (patch)
treeb6c05d5088be1b1275d5422f8b002b9cd42ff1b7 /usr.bin/col/col.c
parent18dac96b7bf3831c3d8393ab93b391c2ca65e6a1 (diff)
downloadsrc-df3f5d9dd51fa82a604ec559a75d3791a7b80ed5.tar.gz
src-df3f5d9dd51fa82a604ec559a75d3791a7b80ed5.zip
Merge from Lite2
Notes
Notes: svn path=/head/; revision=23693
Diffstat (limited to 'usr.bin/col/col.c')
-rw-r--r--usr.bin/col/col.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/col/col.c b/usr.bin/col/col.c
index 37dc3045c48b..e911688606b1 100644
--- a/usr.bin/col/col.c
+++ b/usr.bin/col/col.c
@@ -41,7 +41,7 @@ static char copyright[] =
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)col.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)col.c 8.5 (Berkeley) 5/4/95";
#endif /* not lint */
#include <ctype.h>
@@ -49,6 +49,7 @@ static char sccsid[] = "@(#)col.c 8.3 (Berkeley) 4/2/94";
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
+#include <unistd.h>
#include <locale.h>
#define BS '\b' /* backspace */
@@ -299,6 +300,9 @@ main(argc, argv)
l->l_max_col = cur_col;
cur_col++;
}
+ if (max_line == 0)
+ exit(0); /* no lines, so just exit */
+
/* goto the last line that had a character on it */
for (; l->l_next; l = l->l_next)
this_line++;