aboutsummaryrefslogtreecommitdiff
path: root/libbb/print_file.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-05-15 17:48:09 +0000
committerEric Andersen <andersen@codepoet.org>2001-05-15 17:48:09 +0000
commit55f9872616f0c42f3fb712cfb7f9d0bb52c8afcb (patch)
tree4dc106a5142e993d2a5e9bad32f2fcd53555047c /libbb/print_file.c
parentc911a4389bbaa5ac85d725c8c05e452dfba8583d (diff)
downloadbusybox-w32-55f9872616f0c42f3fb712cfb7f9d0bb52c8afcb.tar.gz
busybox-w32-55f9872616f0c42f3fb712cfb7f9d0bb52c8afcb.tar.bz2
busybox-w32-55f9872616f0c42f3fb712cfb7f9d0bb52c8afcb.zip
This patch from Adam Heath <doogie@debian.org>, makes print_file
(used by cat, grep, sed, etc) quite a bit faster.
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 b47723454..bfedc5eff 100644
--- a/libbb/print_file.c
+++ b/libbb/print_file.c
@@ -26,12 +26,9 @@
26 26
27extern void print_file(FILE *file) 27extern void print_file(FILE *file)
28{ 28{
29 int c;
30
31 while ((c = getc(file)) != EOF)
32 putc(c, stdout);
33 fclose(file);
34 fflush(stdout); 29 fflush(stdout);
30 copyfd(fileno(file), fileno(stdout));
31 fclose(file);
35} 32}
36 33
37extern int print_file_by_name(char *filename) 34extern int print_file_by_name(char *filename)