aboutsummaryrefslogtreecommitdiff
path: root/yes.c
diff options
context:
space:
mode:
authorerik <erik@69ca8d6d-28ef-0310-b511-8ec308f3f277>2000-02-08 19:58:47 +0000
committererik <erik@69ca8d6d-28ef-0310-b511-8ec308f3f277>2000-02-08 19:58:47 +0000
commita18125005d67c38a8ad7fb454571bb996664ad96 (patch)
treec90bda10731ad9333ce3b404f993354c9fc104b8 /yes.c
parent8ef3b44285a8ce5b83bed9cf32ce5f40b30ba72f (diff)
downloadbusybox-w32-a18125005d67c38a8ad7fb454571bb996664ad96.tar.gz
busybox-w32-a18125005d67c38a8ad7fb454571bb996664ad96.tar.bz2
busybox-w32-a18125005d67c38a8ad7fb454571bb996664ad96.zip
Some formatting updates (ran the code through indent)
-Erik git-svn-id: svn://busybox.net/trunk/busybox@357 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'yes.c')
-rw-r--r--yes.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/yes.c b/yes.c
index 96d6257d0..ac67845ac 100644
--- a/yes.c
+++ b/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
25extern int yes_main(int argc, char **argv) { 26extern 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);