mirror of
git://git.suckless.org/sbase
synced 2026-01-26 13:43:17 +00:00
23 lines
347 B
C
23 lines
347 B
C
/* See LICENSE file for copyright and license details. */
|
|
#include <stdarg.h>
|
|
#include <ctype.h>
|
|
|
|
#include "../util.h"
|
|
|
|
int
|
|
confirm(const char *fmt, ...)
|
|
{
|
|
int c, ans;
|
|
va_list ap;
|
|
|
|
va_start(ap, fmt);
|
|
xvprintf(fmt, ap);
|
|
va_end(ap);
|
|
|
|
c = getchar();
|
|
ans = (c == 'y' || c == 'Y');
|
|
while (c != '\n' && c != EOF)
|
|
c = getchar();
|
|
return ans;
|
|
}
|