1 /* vi: set sw=4 ts=4: */
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 tarball for details.
10 /* Read a line from stdin. If the first non-whitespace char is 'y' or 'Y',
11 * return 1. Otherwise return 0.
18 int bb_ask_confirmation(void)
24 while (((c = getchar()) != EOF) && (c != '\n')) {
25 /* Make sure we get the actual function call for isspace,
26 * as speed is not critical here. */
27 if (first && !(isspace)(c)) {
29 if ((c == 'y') || (c == 'Y')) {