Fix malformed build-depends. Update list of bugs to close
[oweals/busybox.git] / yes.c
diff --git a/yes.c b/yes.c
index 97b6f653cd4b0df3f186f632051d9819984ad05d..ad7b98f8418d370e749cfa4c112ca562ada60cc4 100644 (file)
--- a/yes.c
+++ b/yes.c
  *
  */
 
-#include "internal.h"
 #include <stdio.h>
+#include <stdlib.h>
+#include "busybox.h"
 
 extern int yes_main(int argc, char **argv)
 {
        int i;
 
-       if (argc >=1 && *argv[1]=='-') {
-               usage("yes [OPTION]... [STRING]...\n"
-#ifndef BB_FEATURE_TRIVIAL_HELP
-                               "\nRepeatedly outputs a line with all specified STRING(s), or `y'.\n"
-#endif
-                               );
-       }
+       if (argc >= 2 && *argv[1] == '-')
+               show_usage();
 
        if (argc == 1) {
                while (1)
                        if (puts("y") == EOF) {
                                perror("yes");
-                               exit(FALSE);
+                               return EXIT_FAILURE;
                        }
        }
 
@@ -48,7 +44,8 @@ extern int yes_main(int argc, char **argv)
                        if (fputs(argv[i], stdout) == EOF
                                || putchar(i == argc - 1 ? '\n' : ' ') == EOF) {
                                perror("yes");
-                               exit(FALSE);
+                               return EXIT_FAILURE;
                        }
-       exit(TRUE);
+
+       return EXIT_SUCCESS;
 }