Rev | Line | |
---|
[821] | 1 | /* vi: set sw=4 ts=4: */
|
---|
| 2 | /*
|
---|
| 3 | * yes implementation for busybox
|
---|
| 4 | *
|
---|
| 5 | * Copyright (C) 2003 Manuel Novoa III <mjn3@codepoet.org>
|
---|
| 6 | *
|
---|
[1765] | 7 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
|
---|
[821] | 8 | */
|
---|
| 9 |
|
---|
| 10 | /* BB_AUDIT SUSv3 N/A -- Matches GNU behavior. */
|
---|
| 11 |
|
---|
| 12 | /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org)
|
---|
| 13 | *
|
---|
| 14 | * Size reductions and removed redundant applet name prefix from error messages.
|
---|
| 15 | */
|
---|
| 16 |
|
---|
[1765] | 17 | #include "libbb.h"
|
---|
[821] | 18 |
|
---|
[1765] | 19 | /* This is a NOFORK applet. Be very careful! */
|
---|
| 20 |
|
---|
| 21 | int yes_main(int argc, char **argv);
|
---|
[821] | 22 | int yes_main(int argc, char **argv)
|
---|
| 23 | {
|
---|
| 24 | char **first_arg;
|
---|
| 25 |
|
---|
[1765] | 26 | argv[0] = (char*)"y";
|
---|
[821] | 27 | if (argc != 1) {
|
---|
| 28 | ++argv;
|
---|
| 29 | }
|
---|
| 30 |
|
---|
| 31 | first_arg = argv;
|
---|
| 32 | do {
|
---|
[1765] | 33 | while (1) {
|
---|
| 34 | fputs(*argv, stdout);
|
---|
| 35 | if (!*++argv)
|
---|
| 36 | break;
|
---|
| 37 | putchar(' ');
|
---|
| 38 | }
|
---|
[821] | 39 | argv = first_arg;
|
---|
| 40 | } while (putchar('\n') != EOF);
|
---|
| 41 |
|
---|
| 42 | bb_perror_nomsg_and_die();
|
---|
| 43 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.