mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2025-01-26 14:23:28 +08:00
client: Fix argument parsing for commands
This commit is contained in:
parent
c682e426ae
commit
1f9d66f67a
@ -428,11 +428,15 @@ static void rl_handler(char *input)
|
||||
|
||||
add_history(input);
|
||||
|
||||
cmd = strtok(input, " ");
|
||||
cmd = strtok_r(input, " ", &arg);
|
||||
if (!cmd)
|
||||
return;
|
||||
|
||||
arg = strtok(NULL, " ");
|
||||
if (arg) {
|
||||
int len = strlen(arg);
|
||||
if (len > 0 && arg[len - 1] == ' ')
|
||||
arg[len - 1] = '\0';
|
||||
}
|
||||
|
||||
for (i = 0; cmd_table[i].cmd; i++) {
|
||||
if (strcmp(cmd, cmd_table[i].cmd))
|
||||
|
Loading…
Reference in New Issue
Block a user