1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-20 23:05:19 +03:00

Merge pull request #2468 from mikeller/fix_cli_command_parsing

Made command parsing in CLI not treat _ as separator.
This commit is contained in:
J Blackman 2017-02-24 18:46:58 +11:00 committed by GitHub
commit ff40e8c844

View file

@ -3161,7 +3161,7 @@ static void cliMap(char *cmdline)
static char *checkCommand(char *cmdLine, const char *command) static char *checkCommand(char *cmdLine, const char *command)
{ {
if(!strncasecmp(cmdLine, command, strlen(command)) // command names match if(!strncasecmp(cmdLine, command, strlen(command)) // command names match
&& !isalnum((unsigned)cmdLine[strlen(command)])) { // next characted in bufffer is not alphanumeric (command is correctly terminated) && (isspace((unsigned)cmdLine[strlen(command)]) || cmdLine[strlen(command)] == 0)) {
return cmdLine + strlen(command) + 1; return cmdLine + strlen(command) + 1;
} else { } else {
return 0; return 0;