From 75e90b15482184db83f03c67b53d4220888c6c9d Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Fri, 14 Jul 2017 10:47:18 +0200 Subject: cat: fix "cat -An" ignoring -n; make numbering go througn all files function old new delta cat_main 418 428 +10 Signed-off-by: Denys Vlasenko --- coreutils/nl.c | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'coreutils/nl.c') diff --git a/coreutils/nl.c b/coreutils/nl.c index 5c64923bb..dc468a90b 100644 --- a/coreutils/nl.c +++ b/coreutils/nl.c @@ -35,26 +35,6 @@ #include "libbb.h" -void FAST_FUNC print_numbered_lines(struct number_state *ns, const char *filename) -{ - FILE *fp = fopen_or_warn_stdin(filename); - unsigned N = ns->start; - char *line; - - while ((line = xmalloc_fgetline(fp)) != NULL) { - if (ns->all - || (ns->nonempty && line[0]) - ) { - printf("%*u%s%s\n", ns->width, N, ns->sep, line); - N += ns->inc; - } else if (ns->empty_str) - fputs(ns->empty_str, stdout); - free(line); - } - - fclose(fp); -} - int nl_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int nl_main(int argc UNUSED_PARAM, char **argv) { -- cgit v1.2.3