From db2fa0e1059a2426a1afa4fc0c97d6f85f176641 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Sat, 15 Jul 2017 22:56:11 -0400 Subject: Handle yes/no prompts correctly according to the locale --- exec.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'exec.c') diff --git a/exec.c b/exec.c index 3178dbe..62eeaee 100644 --- a/exec.c +++ b/exec.c @@ -342,14 +342,8 @@ static int bfs_exec_spawn(const struct bfs_exec *execbuf) { fprintf(stderr, "%s ", execbuf->argv[i]); } fprintf(stderr, "? "); - fflush(stderr); - int c = getchar(); - bool exec = c == 'y' || c == 'Y'; - while (c != '\n' && c != EOF) { - c = getchar(); - } - if (!exec) { + if (ynprompt() <= 0) { errno = 0; return -1; } -- cgit v1.2.3