Mercurial > hg > toybox
annotate toys/yes.c @ 194:30a6db5a95c2
Add comments about SUSv3 specs (or lack thereof).
author | Rob Landley <rob@landley.net> |
---|---|
date | Mon, 03 Dec 2007 20:05:57 -0600 |
parents | 25447caf1b4b |
children | d4176f3f3835 |
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. |
194
30a6db5a95c2
Add comments about SUSv3 specs (or lack thereof).
Rob Landley <rob@landley.net>
parents:
186
diff
changeset
|
4 * |
30a6db5a95c2
Add comments about SUSv3 specs (or lack thereof).
Rob Landley <rob@landley.net>
parents:
186
diff
changeset
|
5 * Not in SUSv3. |
74 | 6 */ |
7 | |
8 #include "toys.h" | |
9 | |
186
25447caf1b4b
Change command main() functions to return void, and exit(toys.exitval) from
Rob Landley <rob@landley.net>
parents:
151
diff
changeset
|
10 void yes_main(void) |
74 | 11 { |
12 for (;;) { | |
13 int i; | |
14 for (i=0; toys.optargs[i]; i++) { | |
15 if (i) xputc(' '); | |
16 xprintf("%s", toys.optargs[i]); | |
17 } | |
18 if (!i) xputc('y'); | |
19 xputc('\n'); | |
20 } | |
21 } |