Changeset 0cfc18d3 in mainline
- Timestamp:
- 2016-03-16T09:10:42Z (9 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6b00876
- Parents:
- 722bb5a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/console/kconsole.c
r722bb5a r0cfc18d3 370 370 */ 371 371 size_t beg; 372 unsigned sp = 0, narg = 0; 372 373 for (beg = position - 1; (beg > 0) && (!isspace(current[beg])); 373 374 beg--); … … 378 379 wstr_to_str(tmp, position - beg + 1, current + beg); 379 380 381 /* Count which argument number are we tabbing (narg=0 is cmd) */ 382 for (; beg > 0; beg--) { 383 if (isspace(current[beg])) { 384 if (!sp) { 385 narg++; 386 sp = 1; 387 } 388 } 389 else 390 sp = 0; 391 } 392 if (narg && isspace(current[0])) 393 narg--; 394 380 395 int found; 381 if ( beg == 0) {396 if (narg == 0) { 382 397 /* Command completion */ 383 398 found = cmdtab_compl(tmp, STR_BOUNDS(MAX_CMDLINE), indev, … … 386 401 /* Arguments completion */ 387 402 cmd_info_t *cmd = parse_cmd(current); 388 if (!cmd || !cmd->hints_enum )403 if (!cmd || !cmd->hints_enum || cmd->argc < narg) 389 404 continue; 390 405 found = cmdtab_compl(tmp, STR_BOUNDS(MAX_CMDLINE), indev,
Note:
See TracChangeset
for help on using the changeset viewer.