usr.bin/find/misc.c
int
queryuser(char *argv[])
{
	int ch, first, nl;

	fprintf(stderr, "\"%s", *argv);
	while (*++argv)
		fprintf(stderr, " %s", *argv);
	fprintf(stderr, "\"? ");
	fflush(stderr);

	first = ch = getchar();
	for (nl = 0;;) {
		if (ch == '\n') {
			nl = 1;
			break;
		}
		if (ch == EOF)
			break;
		ch = getchar();
	}

	if (!nl) {
		fprintf(stderr, "\n");
		fflush(stderr);
	}
        return (first == 'y');
}
/*
 * queryuser --
 *	print a message to standard error and then read input from standard
 *	input. If the input is 'y' then 1 is returned.
 */
queryuser
print a message to standard error and then read input from standard
input. If the input is 'y' then 1 is returned.
queryuser print a message to standard error and then read input from standard input . If the input is ' y ' then 1 is returned .
int
queryuser(char *argv[])
{
	int ch, first, nl;
	fprintf(stderr, "\"%s", *argv);
	while (*++argv)
		fprintf(stderr, " %s", *argv);
	fprintf(stderr, "\"? ");
	fflush(stderr);
	first = ch = getchar();
	for (nl = 0;;) {
		if (ch == '\n') {
			nl = 1;
			break;
		}
		if (ch == EOF)
			break;
		ch = getchar();
	}
	if (!nl) {
		fprintf(stderr, "\n");
		fflush(stderr);
	}
        return (first == 'y');
}
int queryuser ( char * argv [ ] ) { int ch , first , nl ; fprintf ( stderr , " \" " , * argv ) ; while ( * ++ argv ) fprintf ( stderr , " " , * argv ) ; fprintf ( stderr , " \" " ) ; fflush ( stderr ) ; first = ch = getchar ( ) ; for ( nl = 0 ; ; ) { if ( ch == ' \n ' ) { nl = 1 ; break ; } if ( ch == EOF ) break ; ch = getchar ( ) ; } if ( ! nl ) { fprintf ( stderr , " \n " ) ; fflush ( stderr ) ; } return ( first == ' ' ) ; }
queryuser
      print a message to standard error and then read input from standard
      input.
queryuser print a message to standard error and then read input from standard input .