diff options
author | Erik Andersen <andersen@codepoet.org> | 2000-02-08 19:58:47 +0000 |
---|---|---|
committer | Erik Andersen <andersen@codepoet.org> | 2000-02-08 19:58:47 +0000 |
commit | e49d5ecbbe51718fa925b6890a735e5937cc2aa2 (patch) | |
tree | c90bda10731ad9333ce3b404f993354c9fc104b8 /coreutils/yes.c | |
parent | c0bf817bbc5c7867fbe8fb76d5c39f8ee802692f (diff) | |
download | busybox-w32-e49d5ecbbe51718fa925b6890a735e5937cc2aa2.tar.gz busybox-w32-e49d5ecbbe51718fa925b6890a735e5937cc2aa2.tar.bz2 busybox-w32-e49d5ecbbe51718fa925b6890a735e5937cc2aa2.zip |
Some formatting updates (ran the code through indent)
-Erik
Diffstat (limited to 'coreutils/yes.c')
-rw-r--r-- | coreutils/yes.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/coreutils/yes.c b/coreutils/yes.c index 96d6257d0..ac67845ac 100644 --- a/coreutils/yes.c +++ b/coreutils/yes.c | |||
@@ -1,3 +1,4 @@ | |||
1 | /* vi: set sw=4 ts=4: */ | ||
1 | /* | 2 | /* |
2 | * Mini yes implementation for busybox | 3 | * Mini yes implementation for busybox |
3 | * | 4 | * |
@@ -22,19 +23,22 @@ | |||
22 | #include "internal.h" | 23 | #include "internal.h" |
23 | #include <stdio.h> | 24 | #include <stdio.h> |
24 | 25 | ||
25 | extern int yes_main(int argc, char **argv) { | 26 | extern int yes_main(int argc, char **argv) |
27 | { | ||
26 | int i; | 28 | int i; |
29 | |||
27 | if (argc == 1) | 30 | if (argc == 1) |
28 | while (1) | 31 | while (1) |
29 | if (puts ("y") == EOF) { | 32 | if (puts("y") == EOF) { |
30 | perror ("yes"); | 33 | perror("yes"); |
31 | exit(FALSE); | 34 | exit(FALSE); |
32 | } | 35 | } |
33 | 36 | ||
34 | while (1) | 37 | while (1) |
35 | for (i = 1; i < argc; i++) | 38 | for (i = 1; i < argc; i++) |
36 | if (fputs (argv[i], stdout) == EOF || putchar (i == argc - 1 ? '\n' : ' ') == EOF) { | 39 | if (fputs(argv[i], stdout) == EOF |
37 | perror ("yes"); | 40 | || putchar(i == argc - 1 ? '\n' : ' ') == EOF) { |
41 | perror("yes"); | ||
38 | exit(FALSE); | 42 | exit(FALSE); |
39 | } | 43 | } |
40 | exit(TRUE); | 44 | exit(TRUE); |