| 315 | LINECOUNT + 1 is the number of times that the line occurred. */ |
| 316 | |
| 317 | static void |
| 318 | writeline (struct linebuffer const *line, |
| 319 | bool match, intmax_t linecount) |
| 320 | { |
| 321 | if (! (linecount == 0 ? output_unique |
| 322 | : !match ? output_first_repeated |
| 323 | : output_later_repeated)) |
| 324 | return; |
| 325 | |
| 326 | if (count_occurrences) |
| 327 | printf ("%7jd ", linecount + 1); |
| 328 | |
| 329 | if (fwrite (line->buffer, sizeof (char), line->length, stdout) |
| 330 | != line->length) |
| 331 | write_error (); |
| 332 | } |
| 333 | |
| 334 | /* Process input file INFILE with output to OUTFILE. |
| 335 | If either is "-", use the standard I/O stream for it instead. */ |
no test coverage detected