uniq: dont use count format if empty
This commit is contained in:
parent
695940d50c
commit
b2e73936bf
3
uniq.c
3
uniq.c
|
@ -49,7 +49,8 @@ uniqline(FILE *ofp, char *l)
|
||||||
if (prevline) {
|
if (prevline) {
|
||||||
if ((prevlinecount == 1 && !dflag) ||
|
if ((prevlinecount == 1 && !dflag) ||
|
||||||
(prevlinecount != 1 && !uflag)) {
|
(prevlinecount != 1 && !uflag)) {
|
||||||
fprintf(ofp, countfmt, prevlinecount);
|
if (*countfmt)
|
||||||
|
fprintf(ofp, countfmt, prevlinecount);
|
||||||
fputs(prevline, ofp);
|
fputs(prevline, ofp);
|
||||||
}
|
}
|
||||||
free(prevline);
|
free(prevline);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user