view toys/yes.c @ 232:cd4d5630c978

Move some generated files into the "generated" subdirectory.
author Rob Landley <rob@landley.net>
date Thu, 10 Jan 2008 14:40:13 -0600
parents 30a6db5a95c2
children d4176f3f3835
line wrap: on
line source

/* vi: set sw=4 ts=4: */
/*
 * yes.c - Repeatedly output a string.
 *
 * Not in SUSv3.
 */

#include "toys.h"

void yes_main(void)
{
	for (;;) {
		int i;
		for (i=0; toys.optargs[i]; i++) {
			if (i) xputc(' ');
			xprintf("%s", toys.optargs[i]);
		}
		if (!i) xputc('y');
		xputc('\n');
	}
}