From b81b263bd02eeaeba15c8107c9b30be5c5ad760b Mon Sep 17 00:00:00 2001 From: Kyle K Date: Tue, 24 Sep 2019 08:06:39 +0000 Subject: [PATCH] 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 --- src/main/cli/cli.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/cli/cli.c b/src/main/cli/cli.c index 054a5bb50f..f209fb118f 100644 --- a/src/main/cli/cli.c +++ b/src/main/cli/cli.c @@ -6547,6 +6547,10 @@ bool cliProcessCustomDefaults(void) 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; #if !defined(DEBUG_CUSTOM_DEFAULTS) cliWriter = cliWriterTemp;