Changes in / [d9ffc54:669e9b5] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/console/kconsole.c
rd9ffc54 r669e9b5 362 362 putchar(current[position]); 363 363 364 if (position == 0) 365 continue; 364 366 365 367 /* … … 368 370 */ 369 371 size_t beg; 370 unsigned narg = 0; 371 if (position == 0) { 372 tmp[0] = '\0'; 373 beg = 0; 374 } else { 375 for (beg = position - 1; 376 (beg > 0) && (!isspace(current[beg])); 377 beg--) { 378 ; 379 } 380 381 if (isspace(current[beg])) 382 beg++; 383 384 wstr_to_str(tmp, position - beg + 1, current + beg); 385 } 386 387 /* Count which argument number are we tabbing (narg=0 is cmd) */ 388 bool sp = false; 389 for (; beg > 0; beg--) { 390 if (isspace(current[beg])) { 391 if (!sp) { 392 narg++; 393 sp = true; 394 } 395 } else 396 sp = false; 397 } 398 if (narg && isspace(current[0])) 399 narg--; 400 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 401 380 int found; 402 if ( narg == 0) {381 if (beg == 0) { 403 382 /* Command completion */ 404 383 found = cmdtab_compl(tmp, STR_BOUNDS(MAX_CMDLINE), indev, … … 407 386 /* Arguments completion */ 408 387 cmd_info_t *cmd = parse_cmd(current); 409 if (!cmd || !cmd->hints_enum || cmd->argc < narg)388 if (!cmd || !cmd->hints_enum) 410 389 continue; 411 390 found = cmdtab_compl(tmp, STR_BOUNDS(MAX_CMDLINE), indev,
Note:
See TracChangeset
for help on using the changeset viewer.