diff options
Diffstat (limited to 'coreutils/cat.c')
-rw-r--r-- | coreutils/cat.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/coreutils/cat.c b/coreutils/cat.c index a959805..db4d33d 100644 --- a/coreutils/cat.c +++ b/coreutils/cat.c @@ -11,20 +11,12 @@ /* http://www.opengroup.org/onlinepubs/007904975/utilities/cat.html */ #include "busybox.h" -#include <unistd.h> -int cat_main(int argc, char **argv) +int bb_cat(char **argv) { FILE *f; int retval = EXIT_SUCCESS; - getopt32(argc, argv, "u"); - - argv += optind; - if (!*argv) { - *--argv = "-"; - } - do { f = fopen_or_warn_stdin(*argv); if (f) { @@ -39,3 +31,15 @@ int cat_main(int argc, char **argv) return retval; } + +int cat_main(int argc, char **argv) +{ + getopt32(argc, argv, "u"); + + argv += optind; + if (!*argv) { + *--argv = "-"; + } + + return bb_cat(argv); +} |