Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/console/prompt.c

    rdfc07c1 rf4a8734  
    4343 * @param indev Where to read characters from.
    4444 * @param hints Number of hints that would be displayed.
    45  *
    4645 * @return Whether to print all hints.
    47  *
    4846 */
    4947bool console_prompt_display_all_hints(indev_t *indev, size_t hints)
     
    5149        ASSERT(indev);
    5250        ASSERT(hints > 0);
    53        
    54         printf("Display all %zu possibilities? (y or n) ", hints);
    55        
     51
     52        printf("Display all %zu possibilities? (y or n)", hints);
     53
    5654        while (true) {
    5755                wchar_t answer = indev_pop_character(indev);
    58                
    59                 if ((answer == 'y') || (answer == 'Y')) {
    60                         printf("y");
     56
     57                if (answer == 'y' || answer == 'Y') {
     58                        printf(" y");
    6159                        return true;
    6260                }
    63                
    64                 if ((answer == 'n') || (answer == 'N')) {
    65                         printf("n");
     61
     62                if (answer == 'n' || answer == 'N') {
     63                        printf(" n");
    6664                        return false;
    6765                }
     
    7371 * When the function returns false, @p display_hints is set to zero.
    7472 *
    75  * @param[in]  indev        Where to read characters from.
     73 * @param[in] indev Where to read characters from.
    7674 * @param[out] display_hints How many hints to display.
    77  *
    7875 * @return Whether to display more hints.
    79  *
    8076 */
    8177bool console_prompt_more_hints(indev_t *indev, size_t *display_hints)
     
    8379        ASSERT(indev);
    8480        ASSERT(display_hints != NULL);
    85        
     81
    8682        printf("--More--");
    8783        while (true) {
    8884                wchar_t continue_showing_hints = indev_pop_character(indev);
    8985                /* Display a full page again? */
    90                 if ((continue_showing_hints == 'y') ||
    91                     (continue_showing_hints == 'Y') ||
    92                     (continue_showing_hints == ' ')) {
     86                if (continue_showing_hints == 'y'
     87                    || continue_showing_hints == 'Y'
     88                    || continue_showing_hints == ' ') {
    9389                        *display_hints = MAX_TAB_HINTS - 1;
    9490                        break;
    9591                }
    96                
     92
    9793                /* Stop displaying hints? */
    98                 if ((continue_showing_hints == 'n') ||
    99                     (continue_showing_hints == 'N') ||
    100                     (continue_showing_hints == 'q') ||
    101                     (continue_showing_hints == 'Q')) {
     94                if (continue_showing_hints == 'n'
     95                    || continue_showing_hints == 'N'
     96                    || continue_showing_hints == 'q'
     97                    || continue_showing_hints == 'Q') {
    10298                        *display_hints = 0;
    10399                        break;
    104100                }
    105                
     101
    106102                /* Show one more hint? */
    107103                if (continue_showing_hints == '\n') {
     
    110106                }
    111107        }
    112        
     108
    113109        /* Delete the --More-- option */
    114110        printf("\r         \r");
    115        
     111
    116112        return *display_hints > 0;
    117113}
Note: See TracChangeset for help on using the changeset viewer.