summaryrefslogtreecommitdiff
path: root/libbb/print_file.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbb/print_file.c')
-rw-r--r--libbb/print_file.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/libbb/print_file.c b/libbb/print_file.c
index b477234..bfedc5e 100644
--- a/libbb/print_file.c
+++ b/libbb/print_file.c
@@ -26,12 +26,9 @@
extern void print_file(FILE *file)
{
- int c;
-
- while ((c = getc(file)) != EOF)
- putc(c, stdout);
- fclose(file);
fflush(stdout);
+ copyfd(fileno(file), fileno(stdout));
+ fclose(file);
}
extern int print_file_by_name(char *filename)