]>
diplodocus.org Git - nmh/blob - sbr/read_yes_or_no_if_tty.c
1 /* read_yes_or_no_if_tty.c -- get a yes/no answer from the user
3 * This code is Copyright (c) 2002, by the authors of nmh. See the
4 * COPYRIGHT file in the root directory of the nmh distribution for
5 * complete copyright information.
12 read_yes_or_no_if_tty (const char *prompt
)
14 static int interactive
= -1;
17 interactive
= isatty (fileno (stdin
));
19 return interactive
? read_switch(prompt
, anoyes
) : 1;