On 2012-02-09, at 23:52, Connor Lane Smith wrote:

> const char *s = (argc < 2) ? "y" : argv[1];
> while(puts(s) != EOF);

On 2012-02-10, at 10:12, clamiax wrote:

> http://cvsweb.netbsd.org/bsdweb.cgi/src/usr.bin/yes/yes.c?rev=1.8.22.1&content-type=text/x-cvsweb-markup


How about:

#include <stdio.h>

int
main(int argc, char **argv)
{
        const char *s = (argc > 1) ? argv[1] : "y";
        while(puts(s) != EOF);

        return 1;
}


Reply via email to