Update the lash shell (hopefully the last time...) so things like
[oweals/busybox.git] / printf.c
index 41ab2e4426e6c4ad88f157843ecc6ea138ed6465..003423d5615b9a7976db7858c9123b32b8dd40c4 100644 (file)
--- a/printf.c
+++ b/printf.c
 
 //   19990508 Busy Boxed! Dave Cinege
 
-#include "internal.h"
 #include <unistd.h>
 #include <stdio.h>
 #include <sys/types.h>
-#include <getopt.h>
-#include <sys/stat.h>
 #include <string.h>
 #include <errno.h>
 #include <stdlib.h>
 #include <fcntl.h>
 #include <ctype.h>
-#include <libintl.h>
+#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,8 +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";
-
 int printf_main(int argc, char **argv)
 {
        char *format;
@@ -148,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];
@@ -167,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