Ignore:
File:
1 edited

Legend:

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

    r6b00876 rdc0e41c  
    362362                                putchar(current[position]);
    363363                       
     364                        if (position == 0)
     365                                continue;
    364366                       
    365367                        /*
     
    368370                         */
    369371                        size_t beg;
    370                         unsigned sp = 0, narg = 0;
    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                         }
    384                        
    385                         /* Count which argument number are we tabbing (narg=0 is cmd) */
    386                         for (; beg > 0; beg--) {
    387                                 if (isspace(current[beg])) {
    388                                         if (!sp) {
    389                                                 narg++;
    390                                                 sp = 1;
    391                                         }
    392                                 }
    393                                 else
    394                                         sp = 0;
    395                         }
    396                         if (narg && isspace(current[0]))
    397                                 narg--;
    398 
     372                        for (beg = position - 1; (beg > 0) && (!isspace(current[beg]));
     373                            beg--);
     374                       
     375                        if (isspace(current[beg]))
     376                                beg++;
     377                       
     378                        wstr_to_str(tmp, position - beg + 1, current + beg);
     379                       
    399380                        int found;
    400                         if (narg == 0) {
     381                        if (beg == 0) {
    401382                                /* Command completion */
    402383                                found = cmdtab_compl(tmp, STR_BOUNDS(MAX_CMDLINE), indev,
     
    405386                                /* Arguments completion */
    406387                                cmd_info_t *cmd = parse_cmd(current);
    407                                 if (!cmd || !cmd->hints_enum || cmd->argc < narg)
     388                                if (!cmd || !cmd->hints_enum)
    408389                                        continue;
    409390                                found = cmdtab_compl(tmp, STR_BOUNDS(MAX_CMDLINE), indev,
Note: See TracChangeset for help on using the changeset viewer.