aboutsummaryrefslogtreecommitdiff
path: root/cat.c
diff options
context:
space:
mode:
authorPavel Roskin <proski@gnu.org>2000-07-17 20:18:42 +0000
committerPavel Roskin <proski@gnu.org>2000-07-17 20:18:42 +0000
commitcc8a66b113dbdf04082b6f7c9b0b58984d433028 (patch)
tree98490b8eadc4e44b46c073fa2d21de403a2b61d4 /cat.c
parent97562bd9d7fe18bdc4f63e6e80bdce980416a915 (diff)
downloadbusybox-cc8a66b113dbdf04082b6f7c9b0b58984d433028.tar.gz
Moved functions used by "lsmod" from cat.c to utility.c
Adjusted to make lsmod and sh compilable as standalone apps. Comment fixes
Diffstat (limited to 'cat.c')
-rw-r--r--cat.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/cat.c b/cat.c
index c27f07e82..6a9204fe7 100644
--- a/cat.c
+++ b/cat.c
@@ -24,20 +24,8 @@
#include "internal.h"
#include <stdio.h>
-static void print_file(FILE * file)
-{
- int c;
-
- while ((c = getc(file)) != EOF)
- putc(c, stdout);
- fclose(file);
- fflush(stdout);
-}
-
extern int cat_main(int argc, char **argv)
{
- FILE *file;
-
if (argc == 1) {
print_file(stdin);
exit(TRUE);
@@ -47,12 +35,10 @@ extern int cat_main(int argc, char **argv)
usage(cat_usage);
while (--argc > 0) {
- file = fopen(*++argv, "r");
- if (file == NULL) {
+ if (print_file_by_name(*++argv) == FALSE) {
perror(*argv);
exit(FALSE);
}
- print_file(file);
}
return(TRUE);
}