Alters the behavior of the 'Create NAT on tunnel' to also add the appropriate NAT...
[tomato.git] / release / src / router / busybox / libbb / ask_confirmation.c
blobd95729cc99beff60d823c4531723a525ada5004b
1 /* vi: set sw=4 ts=4: */
2 /*
3 * bb_ask_confirmation implementation for busybox
5 * Copyright (C) 2003 Manuel Novoa III <mjn3@codepoet.org>
7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */
10 /* Read a line from stdin. If the first non-whitespace char is 'y' or 'Y',
11 * return 1. Otherwise return 0.
13 #include "libbb.h"
15 int FAST_FUNC bb_ask_confirmation(void)
17 char first = 0;
18 int c;
20 while (((c = getchar()) != EOF) && (c != '\n')) {
21 if (first == 0 && !isblank(c)) {
22 first = c|0x20;
26 return first == 'y';