diff options
author | peter <peter@FreeBSD.org> | 1997-03-11 13:43:33 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1997-03-11 13:43:33 +0000 |
commit | deba7db48c7897a6302d3d706887bbddc3604c00 (patch) | |
tree | de15b52a10645135d816eb7c2d0fdc19e613c445 /usr.bin/col | |
parent | dc74a95b3c87ac7e618302b89dfff6205c05cfc0 (diff) | |
download | FreeBSD-src-deba7db48c7897a6302d3d706887bbddc3604c00.zip FreeBSD-src-deba7db48c7897a6302d3d706887bbddc3604c00.tar.gz |
Merge from Lite2
Diffstat (limited to 'usr.bin/col')
-rw-r--r-- | usr.bin/col/col.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/col/col.c b/usr.bin/col/col.c index 37dc304..e911688 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++; |