aboutsummaryrefslogtreecommitdiff
path: root/libbb/print_file.c
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-05-15 17:48:09 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-05-15 17:48:09 +0000
commitf38d6caa4940b7f307a4e4e748fcfeea3b50977a (patch)
tree4dc106a5142e993d2a5e9bad32f2fcd53555047c /libbb/print_file.c
parent4556650b13ac68ca7a536ac1664cc66cbb3e3b23 (diff)
downloadbusybox-w32-f38d6caa4940b7f307a4e4e748fcfeea3b50977a.tar.gz
busybox-w32-f38d6caa4940b7f307a4e4e748fcfeea3b50977a.tar.bz2
busybox-w32-f38d6caa4940b7f307a4e4e748fcfeea3b50977a.zip
This patch from Adam Heath <doogie@debian.org>, makes print_file
(used by cat, grep, sed, etc) quite a bit faster. git-svn-id: svn://busybox.net/trunk/busybox@2648 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to '')
-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)