[hackers] [sbase] uniq: dont use count format if empty || Hiltjo Posthuma
commit 559a730d5fc5b91e069f88cd9b2f0acbd07040b1
Author: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Sat Mar 7 14:04:04 2015 +0100
uniq: dont use count format if empty
diff --git a/uniq.c b/uniq.c
index b200154..db30afe 100644
--- a/uniq.c
+++ b/uniq.c
_AT_@ -49,7 +49,8 @@ uniqline(FILE *ofp, char *l)
if (prevline) {
if ((prevlinecount == 1 && !dflag) ||
(prevlinecount != 1 && !uflag)) {
- fprintf(ofp, countfmt, prevlinecount);
+ if (*countfmt)
+ fprintf(ofp, countfmt, prevlinecount);
fputs(prevline, ofp);
}
free(prevline);
Received on Sun Mar 08 2015 - 12:50:38 CET
This archive was generated by hypermail 2.3.0
: Sun Mar 08 2015 - 13:00:18 CET