]> diplodocus.org Git - nmh/blob - sbr/getanswer.c
Just reworded the bit about '%s' being safe not to quote (it's only safe not to
[nmh] / sbr / getanswer.c
1
2 /*
3 * getanswer.c -- get a yes/no answer from the user
4 */
5
6 #include <h/mh.h>
7 #include <stdio.h>
8
9
10 int
11 getanswer (char *prompt)
12 {
13 static int interactive = -1;
14
15 if (interactive < 0)
16 interactive = isatty (fileno (stdin)) ? 1 : 0;
17
18 return (interactive ? gans (prompt, anoyes) : 1);
19 }