]> Kevux Git Server - fll/commitdiff
Bugfix: FSS Write programs don't correctly handle multi-Content per Object situations.
authorKevin Day <kevin@kevux.org>
Tue, 24 Jan 2023 03:00:30 +0000 (21:00 -0600)
committerKevin Day <kevin@kevux.org>
Tue, 24 Jan 2023 03:00:30 +0000 (21:00 -0600)
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
level_3/fss_write/c/main/print.c

index 15974cf7a86fe3f9b56128142c4388000d3ac418..b609d99b6de2f93e74da2afaa7b7be8f55c4ee60 100644 (file)
@@ -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)) {
index 8eb931caf453e777851131882aca4beb5e3ba3e7..28d0623e3d92c9f189e7afbf1c406f29535475d4 100644 (file)
@@ -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);