Changeset 07bd114e in mainline for generic/src/console/kconsole.c


Ignore:
Timestamp:
2005-12-17T00:08:13Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2cf87e50
Parents:
c43fa55
Message:

Fixed kconsole resolution of similar commands.
Add commands to debugger to allow for simple profiling or
calling debug actions if needed.

File:
1 edited

Legend:

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

    rc43fa55 r07bd114e  
    118118                        spinlock_lock(&hlp->lock);
    119119                }
    120                
    121                 if ((strncmp(hlp->name, cmd->name, strlen(cmd->name)) == 0)) {
     120                if ((strncmp(hlp->name,
     121                             cmd->name, max(strlen(cmd->name),
     122                                            strlen(hlp->name))) == 0)) {
    122123                        /* The command is already there. */
    123124                        spinlock_unlock(&hlp->lock);
     
    140141}
    141142
     143/** Print count times a character */
    142144static void rdln_print_c(char ch, int count)
    143145{
     
    147149}
    148150
     151/** Insert character to string */
    149152static void insert_char(char *str, char ch, int pos)
    150153{
     
    156159}
    157160
     161/** Try to find a command begenning with prefix */
    158162static const char * cmdtab_search_one(const char *name,link_t **startpos)
    159163{
     
    482486                spinlock_lock(&hlp->lock);
    483487               
    484                 if (strncmp(hlp->name, &cmdline[start], strlen(hlp->name)) == 0) {
     488                if (strncmp(hlp->name, &cmdline[start], max(strlen(hlp->name),
     489                                                            end-start+1)) == 0) {
    485490                        cmd = hlp;
    486491                        break;
Note: See TracChangeset for help on using the changeset viewer.