mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-16 21:05:35 +03:00
Ignore spaces and = in cli
This commit is contained in:
parent
37d798e5bc
commit
33b6bac38f
1 changed files with 7 additions and 2 deletions
|
@ -2173,15 +2173,20 @@ static void cliSet(char *cmdline)
|
|||
cliPrint("\r\n");
|
||||
}
|
||||
} else if ((eqptr = strstr(cmdline, "=")) != NULL) {
|
||||
// has equal, set var
|
||||
// has equals
|
||||
|
||||
char *lastNonSpaceCharacter = eqptr;
|
||||
while (*(lastNonSpaceCharacter - 1) == ' ') {
|
||||
lastNonSpaceCharacter--;
|
||||
}
|
||||
uint8_t variableNameLength = lastNonSpaceCharacter - cmdline;
|
||||
|
||||
// skip the '=' and any ' ' characters
|
||||
eqptr++;
|
||||
len--;
|
||||
while (*(eqptr) == ' ') {
|
||||
eqptr++;
|
||||
}
|
||||
|
||||
for (i = 0; i < VALUE_COUNT; i++) {
|
||||
val = &valueTable[i];
|
||||
// ensure exact match when setting to prevent setting variables with shorter names
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue