summaryrefslogtreecommitdiffstats
path: root/usr.bin/uniq
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1997-03-11 13:08:12 +0000
committerpeter <peter@FreeBSD.org>1997-03-11 13:08:12 +0000
commit297505f8fa9ec32b558f82504c27404854c3e313 (patch)
tree5902089a1ad90a715cb57bccc9fcdee6a33122e7 /usr.bin/uniq
parentcc62aa07770cbb99fb48c7068048a9fbd9326313 (diff)
downloadFreeBSD-src-297505f8fa9ec32b558f82504c27404854c3e313.zip
FreeBSD-src-297505f8fa9ec32b558f82504c27404854c3e313.tar.gz
Import some parts of CSRG 4.4BSD-Lite2 usr.bin sources to fix tree build.
Diffstat (limited to 'usr.bin/uniq')
-rw-r--r--usr.bin/uniq/uniq.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/uniq/uniq.c b/usr.bin/uniq/uniq.c
index e84f82e..b2b85e1 100644
--- a/usr.bin/uniq/uniq.c
+++ b/usr.bin/uniq/uniq.c
@@ -41,7 +41,7 @@ static char copyright[] =
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)uniq.c 8.1 (Berkeley) 6/6/93";
+static char sccsid[] = "@(#)uniq.c 8.3 (Berkeley) 5/4/95";
#endif /* not lint */
#include <errno.h>
@@ -49,6 +49,7 @@ static char sccsid[] = "@(#)uniq.c 8.1 (Berkeley) 6/6/93";
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
#define MAXLINELEN (8 * 1024)
@@ -171,7 +172,8 @@ show(ofp, str)
FILE *ofp;
char *str;
{
- if (cflag)
+
+ if (cflag && *str)
(void)fprintf(ofp, "%4d %s", repeats + 1, str);
if (dflag && repeats || uflag && !repeats)
(void)fprintf(ofp, "%s", str);
OpenPOWER on IntegriCloud