1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-15 20:35:33 +03:00

Handle a lack of trailing newline in config file. (#8942)

Handle a lack of trailing newline in config file.
This commit is contained in:
Michael Keller 2019-09-25 23:32:19 +12:00 committed by GitHub
commit 462699d1a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6566,6 +6566,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;