mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 13:23:51 -07:00
readline autocomplete: complete up to next space, so complete one single word at once
This commit is contained in:
parent
a5d491d67a
commit
6597d3e5a5
2 changed files with 12 additions and 2 deletions
|
@ -121,7 +121,12 @@ char* rl_command_generator(const char *text, int state) {
|
||||||
index++;
|
index++;
|
||||||
|
|
||||||
if (strncmp (command, rl_line_buffer, rlen) == 0) {
|
if (strncmp (command, rl_line_buffer, rlen) == 0) {
|
||||||
return strdup(command + (rlen - len));
|
const char *next = command + (rlen - len);
|
||||||
|
const char *space = strstr(next, " ");
|
||||||
|
if (space != NULL) {
|
||||||
|
return strndup(next, space - next);
|
||||||
|
}
|
||||||
|
return strdup(next);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -731,7 +731,12 @@ char* rl_command_generator(const char *text, int state) {
|
||||||
index++;
|
index++;
|
||||||
|
|
||||||
if (strncmp (command, rl_line_buffer, rlen) == 0) {
|
if (strncmp (command, rl_line_buffer, rlen) == 0) {
|
||||||
return strdup(command + (rlen - len));
|
const char *next = command + (rlen - len);
|
||||||
|
const char *space = strstr(next, " ");
|
||||||
|
if (space != NULL) {
|
||||||
|
return strndup(next, space - next);
|
||||||
|
}
|
||||||
|
return strdup(next);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue