X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=coreutils%2Fprintf.c;h=003423d5615b9a7976db7858c9123b32b8dd40c4;hb=eba8ed71f08f334bc94ac8eeedcd998fcdd05897;hp=28a011dcd9236ce598068e65403dfaf5b07b1d3e;hpb=7ab9c7ee52db8759d457819f5480378fa3aa97cc;p=oweals%2Fbusybox.git diff --git a/coreutils/printf.c b/coreutils/printf.c index 28a011dcd..003423d56 100644 --- a/coreutils/printf.c +++ b/coreutils/printf.c @@ -47,22 +47,19 @@ // 19990508 Busy Boxed! Dave Cinege -#include "internal.h" #include #include #include -#include -#include #include #include #include #include #include -#include +#include "busybox.h" #ifndef S_IFMT -# define S_IFMT 0170000 +static const int S_IFMT = 0170000; #endif #if !defined(S_ISBLK) && defined(S_IFBLK) # define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) @@ -139,13 +136,6 @@ static void verify __P((char *s, char *end)); /* The value to return to the calling program. */ static int exit_status; -static const char printf_usage[] = "printf FORMAT [ARGUMENT...]\n" -#ifndef BB_FEATURE_TRIVIAL_HELP - "\nFormats and prints ARGUMENT(s) according to FORMAT,\n" - "Where FORMAT controls the output exactly as in C printf.\n" -#endif - ; - int printf_main(int argc, char **argv) { char *format; @@ -153,7 +143,7 @@ int printf_main(int argc, char **argv) exit_status = 0; if (argc <= 1 || **(argv + 1) == '-') { - usage(printf_usage); + show_usage(); } format = argv[1]; @@ -172,7 +162,7 @@ int printf_main(int argc, char **argv) fprintf(stderr, "excess args ignored"); */ - exit(exit_status); + return(exit_status); } /* Print the text in FORMAT, using ARGV (with ARGC elements) for