Ignore:
Timestamp:
2012-07-20T20:29:54Z (12 years ago)
Author:
Frantisek Princ <frantisek.princ@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
34bc2fe
Parents:
4cdac68 (diff), 6de2d766 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge with mainline

File:
1 edited

Legend:

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

    r4cdac68 rb828907  
    202202 *
    203203 */
    204 NO_TRACE static int cmdtab_compl(char *input, size_t size, indev_t * indev)
     204NO_TRACE static int cmdtab_compl(char *input, size_t size, indev_t *indev)
    205205{
    206206        const char *name = input;
    207207       
    208208        size_t found = 0;
    209         /* Maximum Match Length : Length of longest matching common substring in
    210            case more than one match is found */
     209       
     210        /*
     211         * Maximum Match Length: Length of longest matching common
     212         * substring in case more than one match is found.
     213         */
    211214        size_t max_match_len = size;
    212215        size_t max_match_len_tmp = size;
     
    229232        }
    230233       
    231         /* If possible completions are more than MAX_TAB_HINTS, ask user whether to display them or not. */
     234        /*
     235         * If the number of possible completions is more than MAX_TAB_HINTS,
     236         * ask the user whether to display them or not.
     237         */
    232238        if (found > MAX_TAB_HINTS) {
    233239                printf("\n");
    234                 continue_showing_hints = console_prompt_display_all_hints(indev, found);
     240                continue_showing_hints =
     241                    console_prompt_display_all_hints(indev, found);
    235242        }
    236243       
     
    240247                while (cmdtab_search_one(name, &pos)) {
    241248                        cmd_info_t *hlp = list_get_instance(pos, cmd_info_t, link);
    242 
     249                       
    243250                        if (continue_showing_hints) {
    244251                                printf("%s (%s)\n", hlp->name, hlp->description);
    245252                                --hints_to_show;
    246253                                ++total_hints_shown;
    247 
    248                                 if (hints_to_show == 0 && total_hints_shown != found) { /* Time to ask user to continue */
    249                                         continue_showing_hints = console_prompt_more_hints(indev, &hints_to_show);
     254                               
     255                                if ((hints_to_show == 0) && (total_hints_shown != found)) {
     256                                        /* Ask user to continue */
     257                                        continue_showing_hints =
     258                                            console_prompt_more_hints(indev, &hints_to_show);
    250259                                }
    251260                        }
    252 
     261                       
    253262                        pos = pos->next;
    254                         for(max_match_len_tmp = 0; output[max_match_len_tmp] == hlp->name[input_len + max_match_len_tmp]
    255                                         && max_match_len_tmp < max_match_len; ++max_match_len_tmp);
     263                       
     264                        for (max_match_len_tmp = 0;
     265                            (output[max_match_len_tmp] ==
     266                            hlp->name[input_len + max_match_len_tmp]) &&
     267                            (max_match_len_tmp < max_match_len); ++max_match_len_tmp);
     268                       
    256269                        max_match_len = max_match_len_tmp;
    257270                }
    258                 /* keep only the characters common in all completions */
     271               
     272                /* Keep only the characters common in all completions */
    259273                output[max_match_len] = 0;
    260274        }
     
    310324                                continue;
    311325                       
    312                         /* Find the beginning of the word
    313                            and copy it to tmp */
     326                        /*
     327                         * Find the beginning of the word
     328                         * and copy it to tmp
     329                         */
    314330                        size_t beg;
    315331                        for (beg = position - 1; (beg > 0) && (!isspace(current[beg]));
     
    333349                                continue;
    334350
    335                         /* We have hints, may be many. In case of more than one hint,
    336                            tmp will contain the common prefix. */
     351                        /*
     352                         * We have hints, possibly many. In case of more than one hint,
     353                         * tmp will contain the common prefix.
     354                         */
    337355                        size_t off = 0;
    338356                        size_t i = 0;
     
    340358                                if (!wstr_linsert(current, ch, position + i, MAX_CMDLINE))
    341359                                        break;
     360                               
    342361                                i++;
    343362                        }
Note: See TracChangeset for help on using the changeset viewer.