Mercurial > hg > toybox
annotate toys/yes.c @ 186:25447caf1b4b
Change command main() functions to return void, and exit(toys.exitval) from
the toybox infrastructure instead. Eliminates a return call from each command.
author | Rob Landley <rob@landley.net> |
---|---|
date | Thu, 29 Nov 2007 18:14:37 -0600 |
parents | bb6048c923ec |
children | 30a6db5a95c2 |
rev | line source |
---|---|
74 | 1 /* vi: set sw=4 ts=4: */ |
2 /* | |
151
bb6048c923ec
Add or correct file descriptions
Charlie Shepherd <masterdriverz@gentoo.org>
parents:
74
diff
changeset
|
3 * yes.c - Repeatedly output a string. |
74 | 4 */ |
5 | |
6 #include "toys.h" | |
7 | |
186
25447caf1b4b
Change command main() functions to return void, and exit(toys.exitval) from
Rob Landley <rob@landley.net>
parents:
151
diff
changeset
|
8 void yes_main(void) |
74 | 9 { |
10 for (;;) { | |
11 int i; | |
12 for (i=0; toys.optargs[i]; i++) { | |
13 if (i) xputc(' '); | |
14 xprintf("%s", toys.optargs[i]); | |
15 } | |
16 if (!i) xputc('y'); | |
17 xputc('\n'); | |
18 } | |
19 } |