Apply vodz' last_patch52
[oweals/busybox.git] / libbb / print_file.c
index b477234548177956c77bdff08d44944c81797671..a6df14ed9558f8394eb1ca664298e65c46e5c62a 100644 (file)
@@ -2,7 +2,7 @@
 /*
  * Utility routines.
  *
- * Copyright (C) 1999-2001 Erik Andersen <andersee@debian.org>
+ * Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
 
 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)