projects
/
oweals
/
busybox.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
hush_test: stop mixing tabs/spaces for indentation
[oweals/busybox.git]
/
coreutils
/
yes.c
diff --git
a/coreutils/yes.c
b/coreutils/yes.c
index 97b4fe54c451b173bd44f2eb7700d800cc732a2e..9d3f675501d5b41f525397532fa459b4432d47e8 100644
(file)
--- a/
coreutils/yes.c
+++ b/
coreutils/yes.c
@@
-14,29
+14,28
@@
* Size reductions and removed redundant applet name prefix from error messages.
*/
* Size reductions and removed redundant applet name prefix from error messages.
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include "busybox.h"
+#include "libbb.h"
+/* This is a NOFORK applet. Be very careful! */
+
+int yes_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int yes_main(int argc, char **argv)
{
int yes_main(int argc, char **argv)
{
- static const char fmt_str[] = " %s";
- const char *fmt;
- char **first_arg;
+ char **pp;
-
*argv =
"y";
+
argv[0] = (char*)
"y";
if (argc != 1) {
++argv;
}
if (argc != 1) {
++argv;
}
- first_arg = argv;
do {
do {
- fmt = fmt_str + 1;
- do {
- bb_printf(fmt, *argv);
- fmt = fmt_str;
- } while (*++argv);
- argv = first_arg;
+ pp = argv;
+ while (1) {
+ fputs(*pp, stdout);
+ if (!*++pp)
+ break;
+ putchar(' ');
+ }
} while (putchar('\n') != EOF);
bb_perror_nomsg_and_die();
} while (putchar('\n') != EOF);
bb_perror_nomsg_and_die();