From 520233b3eae8e9e1bfadd0f232a8aacfd8523287 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Tue, 28 Sep 2021 20:37:03 -0500 Subject: [PATCH] Bugfix: When already running as "init", ignore --init parameter. This includes properly handling the default interrupt state. --- level_3/controller/c/controller.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/level_3/controller/c/controller.c b/level_3/controller/c/controller.c index cde98f0..8d46b61 100644 --- a/level_3/controller/c/controller.c +++ b/level_3/controller/c/controller.c @@ -200,7 +200,7 @@ extern "C" { } } else { - if (main->parameters[controller_parameter_init].result == f_console_result_found) { + if (main->parameters[controller_parameter_init].result == f_console_result_found && !main->as_init) { status = f_string_append(controller_path_settings_init, controller_path_settings_init_length, &setting.path_setting); } else if (main->setting_default.used) { @@ -336,14 +336,14 @@ extern "C" { } } - // when a default setting is not provided, then make the program interruptable by default. - if (main->setting_default.used) { - if (main->parameters[controller_parameter_interruptable].result == f_console_result_found) { + // The interruptable default is dependent on the "as init" execution state. + if (main->as_init) { + if (main->parameters[controller_parameter_uninterruptable].result == f_console_result_none) { setting.interruptable = F_true; } } else { - if (main->parameters[controller_parameter_uninterruptable].result == f_console_result_none) { + if (main->parameters[controller_parameter_interruptable].result == f_console_result_found) { setting.interruptable = F_true; } } -- 1.8.3.1