summaryrefslogtreecommitdiffstats
path: root/usr.bin/uniq/uniq.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/uniq/uniq.c')
-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