From f699b858cebeb14fe2180f90d76afe7f66e65e79 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Mon, 23 Jan 2023 21:00:30 -0600 Subject: [PATCH] Bugfix: FSS Write programs don't correctly handle multi-Content per Object situations. The FSS Extended should support one or more Content per Object. All others support the same number of Objects as Content (not referring to nested Content). The error and error message when this is and is not correctly being handled. The correct detection needs to count based on sub locations rather than locations. Remove now pointless and misleading checks. --- level_3/fss_write/c/main/common.c | 28 ++++++---------------------- level_3/fss_write/c/main/print.c | 6 +++--- 2 files changed, 9 insertions(+), 25 deletions(-) diff --git a/level_3/fss_write/c/main/common.c b/level_3/fss_write/c/main/common.c index 15974cf..b609d99 100644 --- a/level_3/fss_write/c/main/common.c +++ b/level_3/fss_write/c/main/common.c @@ -630,30 +630,14 @@ extern "C" { if (setting->flag & (fss_write_flag_object_e | fss_write_flag_content_e)) { if (setting->flag & fss_write_flag_object_e) { - if (main->parameters.array[fss_write_parameter_object_e].locations.used != main->parameters.array[fss_write_parameter_object_e].values.used) { - setting->status = F_status_set_error(F_parameter); - - fss_write_print_line_first_locked(setting, main->error); - fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, fss_write_long_object_s); - - return; - } - - if (main->parameters.array[fss_write_parameter_content_e].locations.used != main->parameters.array[fss_write_parameter_content_e].values.used) { - setting->status = F_status_set_error(F_parameter); - - fss_write_print_line_first_locked(setting, main->error); - fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, fss_write_long_content_s); - - return; - } - - if (main->parameters.array[fss_write_parameter_object_e].locations.used > main->parameters.array[fss_write_parameter_content_e].locations.used && !(setting->flag & fss_write_flag_partial_e)) { - setting->status = F_status_set_error(F_parameter); + if (setting->flag & fss_write_flag_content_multiple_e) { + if (main->parameters.array[fss_write_parameter_object_e].locations_sub.used > main->parameters.array[fss_write_parameter_content_e].locations_sub.used && !(setting->flag & fss_write_flag_partial_e)) { + setting->status = F_status_set_error(F_parameter); - fss_write_print_error_parameter_same_times_at_least(setting, main->error); + fss_write_print_error_parameter_same_times_at_least(setting, main->error); - return; + return; + } } if ((setting->flag & fss_write_flag_content_e) && (setting->flag & fss_write_flag_partial_e)) { diff --git a/level_3/fss_write/c/main/print.c b/level_3/fss_write/c/main/print.c index 8eb931c..28d0623 100644 --- a/level_3/fss_write/c/main/print.c +++ b/level_3/fss_write/c/main/print.c @@ -37,10 +37,10 @@ extern "C" { fss_write_print_line_first_unlocked(setting, print); fl_print_format("%[%QMust specify the '%]", print.to, print.context, print.prefix, print.context); - fl_print_format("%[%r%r%]", print.to, print.notable, f_console_symbol_long_normal_s, fss_write_long_object_s, print.notable); - fl_print_format("%[' parameter and the '%]", print.to, print.context, print.context); fl_print_format("%[%r%r%]", print.to, print.notable, f_console_symbol_long_normal_s, fss_write_long_content_s, print.notable); - fl_print_format("%[' parameter at least the same number of times when not specifying the '%]", print.to, print.context, print.context); + fl_print_format("%[' parameter at least the same number of times as the '%]", print.to, print.context, print.context); + fl_print_format("%[%r%r%]", print.to, print.notable, f_console_symbol_long_normal_s, fss_write_long_object_s, print.notable); + fl_print_format("%[' parameter when not specifying the '%]", print.to, print.context, print.context); fl_print_format("%[%r%r%]", print.to, print.notable, f_console_symbol_long_normal_s, fss_write_long_partial_s, print.notable); fl_print_format("%[' parameter.%]%r", print.to, print.context, print.context, f_string_eol_s); -- 1.8.3.1