mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-14 11:59:58 +03:00
Handle a lack of trailing newline in config file.
The configurator properly checks that the config data fits, so there is no risk of a command being cut off
This commit is contained in:
parent
a54c33b952
commit
b81b263bd0
1 changed files with 4 additions and 0 deletions
|
@ -6547,6 +6547,10 @@ bool cliProcessCustomDefaults(void)
|
||||||
processCharacter(*customDefaultsPtr++);
|
processCharacter(*customDefaultsPtr++);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Process a newline at the very end so that the last command gets executed,
|
||||||
|
// even when the file did not contain a trailing newline
|
||||||
|
processCharacter('\r');
|
||||||
|
|
||||||
processingCustomDefaults = false;
|
processingCustomDefaults = false;
|
||||||
#if !defined(DEBUG_CUSTOM_DEFAULTS)
|
#if !defined(DEBUG_CUSTOM_DEFAULTS)
|
||||||
cliWriter = cliWriterTemp;
|
cliWriter = cliWriterTemp;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue