sbase

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

yes.c (367B)


      1 /* See LICENSE file for copyright and license details. */
      2 #include <stdio.h>
      3 
      4 #include "util.h"
      5 
      6 int
      7 main(int argc, char *argv[])
      8 {
      9 	char **p;
     10 
     11 	argv0 = *argv, argv0 ? (argc--, argv++) : (void *)0;
     12 
     13 	for (p = argv; ; p = (*p && *(p + 1)) ? p + 1 : argv) {
     14 		fputs(*p ? *p : "y", stdout);
     15 		putchar((!*p || !*(p + 1)) ? '\n' : ' ');
     16 	}
     17 
     18 	return 1; /* not reached */
     19 }