Changes in kernel/generic/src/console/kconsole.c [dc0e41c:6b00876] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/console/kconsole.c
rdc0e41c r6b00876 362 362 putchar(current[position]); 363 363 364 if (position == 0)365 continue;366 364 367 365 /* … … 370 368 */ 371 369 size_t beg; 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 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 380 399 int found; 381 if ( beg == 0) {400 if (narg == 0) { 382 401 /* Command completion */ 383 402 found = cmdtab_compl(tmp, STR_BOUNDS(MAX_CMDLINE), indev, … … 386 405 /* Arguments completion */ 387 406 cmd_info_t *cmd = parse_cmd(current); 388 if (!cmd || !cmd->hints_enum )407 if (!cmd || !cmd->hints_enum || cmd->argc < narg) 389 408 continue; 390 409 found = cmdtab_compl(tmp, STR_BOUNDS(MAX_CMDLINE), indev,
Note:
See TracChangeset
for help on using the changeset viewer.