X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=coreutils%2Fyes.c;h=7d9596d0bf72156b53426ec0013254a6fdd127a1;hb=6aabfd5e30087bb0ffdb6404aa6d650014de2dc0;hp=1718af4bb8891d46b9a72e1e0c51d5ce8d9378eb;hpb=9c8ffa02f4ecd6029233de9d5cdc695fc82fc6df;p=oweals%2Fbusybox.git diff --git a/coreutils/yes.c b/coreutils/yes.c index 1718af4bb..7d9596d0b 100644 --- a/coreutils/yes.c +++ b/coreutils/yes.c @@ -20,26 +20,24 @@ * */ -#include "internal.h" +/* getopt not needed */ + #include +#include +#include "busybox.h" extern int yes_main(int argc, char **argv) { int i; - if (argc >= 2 && *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 +46,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; }