From: Kevin Day Date: Wed, 29 Sep 2021 01:37:03 +0000 (-0500) Subject: Bugfix: When already running as "init", ignore --init parameter. X-Git-Tag: 0.5.6~32 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=520233b3eae8e9e1bfadd0f232a8aacfd8523287;p=fll Bugfix: When already running as "init", ignore --init parameter. This includes properly handling the default interrupt state. --- 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; } }