Ignore:
Timestamp:
Feb 25, 2011, 9:26:54 PM (13 years ago)
Author:
Bruno Cornec
Message:
  • Update mindi-busybox to 1.18.3 to avoid problems with the tar command which is now failing on recent versions with busybox 1.7.3
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.9/mindi-busybox/libbb/ask_confirmation.c

    r1765 r2725  
    55 * Copyright (C) 2003  Manuel Novoa III  <mjn3@codepoet.org>
    66 *
    7  * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
     7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
    88 */
    99
     
    1111 * return 1.  Otherwise return 0.
    1212 */
    13 
    1413#include "libbb.h"
    1514
    16 int bb_ask_confirmation(void)
     15int FAST_FUNC bb_ask_confirmation(void)
    1716{
    18     int retval = 0;
    19     int first = 1;
     17    char first = 0;
    2018    int c;
    2119
    2220    while (((c = getchar()) != EOF) && (c != '\n')) {
    23         /* Make sure we get the actual function call for isspace,
    24          * as speed is not critical here. */
    25         if (first && !(isspace)(c)) {
    26             --first;
    27             if ((c == 'y') || (c == 'Y')) {
    28                 ++retval;
    29             }
     21        if (first == 0 && !isblank(c)) {
     22            first = c|0x20;
    3023        }
    3124    }
    3225
    33     return retval;
     26    return first == 'y';
    3427}
Note: See TracChangeset for help on using the changeset viewer.