view toys/yes.c @ 126:7b22987a7b47

Vladimir Oleynik pointed out that va_start() twice in the same function isn't portable (with ppc 4xx as an example of a platform it doesn't work on). This is why va_copy exists.
author Rob Landley <rob@landley.net>
date Fri, 15 Jun 2007 15:16:46 -0400
parents dfe99495acbc
children bb6048c923ec
line wrap: on
line source

/* vi: set sw=4 ts=4: */
/*
 * hello.c - A hello world program.
 */

#include "toys.h"

int 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');
	}

	return 0;
}