Ignore:
Timestamp:
2016-03-16T09:22:06Z (8 years ago)
Author:
Aurelio Colosimo <aurelio@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d9ffc54
Parents:
0cfc18d3
Message:

kconsole tab completion: permit tab at first char too

This patch makes it possible, for the user, to tab the first char,
so that a list of available commands is shown: a quick alternative
to typing "help".

File:
1 edited

Legend:

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

    r0cfc18d3 r6b00876  
    362362                                putchar(current[position]);
    363363                       
    364                         if (position == 0)
    365                                 continue;
    366364                       
    367365                        /*
     
    371369                        size_t beg;
    372370                        unsigned sp = 0, narg = 0;
    373                         for (beg = position - 1; (beg > 0) && (!isspace(current[beg]));
    374                             beg--);
    375                        
    376                         if (isspace(current[beg]))
    377                                 beg++;
    378                        
    379                         wstr_to_str(tmp, position - beg + 1, current + beg);
     371                        if (position == 0) {
     372                                tmp[0] = '\0';
     373                                beg = 0;
     374                        }
     375                        else {
     376                                for (beg = position - 1; (beg > 0) && (!isspace(current[beg]));
     377                                    beg--);
     378                               
     379                                if (isspace(current[beg]))
     380                                        beg++;
     381                               
     382                                wstr_to_str(tmp, position - beg + 1, current + beg);
     383                        }
    380384                       
    381385                        /* Count which argument number are we tabbing (narg=0 is cmd) */
Note: See TracChangeset for help on using the changeset viewer.