openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/shadow/4.6-r0/shadow-4.6/libmisc/yesno.c
bool yes_or_no(bool read_only)
{
    char buf[80];

    /*
     * In read-only mode all questions are answered "no".
     */
    if (read_only)
    {
        (void)puts(_("No"));
        return false;
    }

    /*
     * Typically, there's a prompt on stdout, sometimes unflushed.
     */
    (void)fflush(stdout);

    /*
     * Get a line and see what the first character is.
     */
    /* TODO: use gettext */
    if (fgets(buf, (int)sizeof buf, stdin) == buf)
    {
        return buf[0] == 'y' || buf[0] == 'Y';
    }

    return false;
}
/*
 * yes_or_no - get answer to question from the user
 *
 *	It returns false if no.
 *
 *	If the read_only flag is set, it will print No, and will return
 *	false.
 */
get answer to question from the user
It returns false if no.

If the read_only flag is set, it will print No, and will return
false.
get answer to question from the user It returns false if no . If the read_only flag is set it will print No and will return false .
bool yes_or_no(bool read_only)
{
    char buf[80];
    if (read_only)
    {
        (void)puts(_("No"));
        return false;
    }
    (void)fflush(stdout);
    if (fgets(buf, (int)sizeof buf, stdin) == buf)
    {
        return buf[0] == 'y' || buf[0] == 'Y';
    }
    return false;
}
bool yes_or_no ( bool read_only ) { char buf [ 80 ] ; if ( read_only ) { ( void ) puts ( _ ( " " ) ) ; return false ; } ( void ) fflush ( stdout ) ; if ( fgets ( buf , ( int ) sizeof buf , stdin ) == buf ) { return buf [ 0 ] == ' ' || buf [ 0 ] == ' ' ; } return false ; }
yes_or_no - get answer to question from the user
      It returns false if no.
yes_or_no - get answer to question from the user It returns false if no .
/*
     * In read-only mode all questions are answered "no".
     */ /*
     * Typically, there's a prompt on stdout, sometimes unflushed.
     */ /*
     * Get a line and see what the first character is.
     */ /* TODO: use gettext */