]> Kevux Git Server - fll/commitdiff
Bugfix: FSS Extended Read needs to only print new line if Object or Content is printed.
authorKevin Day <Kevin@kevux.org>
Tue, 13 Aug 2024 17:29:03 +0000 (12:29 -0500)
committerKevin Day <Kevin@kevux.org>
Tue, 13 Aug 2024 17:29:03 +0000 (12:29 -0500)
Do not always print the new line for the case when printing Object or Content.
When the Content is being printed and is empty Content, then do not print the new line.

level_3/fss_extended_read/c/private-print.c

index f94030d..bd913d9 100644 (file)
@@ -79,9 +79,9 @@ extern "C" {
       if ((data->option & fss_extended_read_data_option_content_d) && data->contents.array[at].used) {
         if (data->option & fss_extended_read_data_option_select_d) {
           if (data->select < data->contents.array[at].used) {
-            content_printed = F_true;
-
             if ((data->option & fss_extended_read_data_option_original_d) && data->quotes_content.array[at].array[data->select]) {
+              content_printed = F_true;
+
               f_print_dynamic_raw(
                 data->quotes_content.array[at].array[data->select] == f_fss_quote_type_single_e
                   ? f_fss_quote_single_s
@@ -92,9 +92,15 @@ extern "C" {
               );
             }
 
-            f_print_except_dynamic_partial(data->buffer, data->contents.array[at].array[data->select], delimits_content, main->output.to.stream);
+            if (data->contents.array[at].array[data->select].start <= data->contents.array[at].array[data->select].stop) {
+              content_printed = F_true;
+
+              f_print_except_dynamic_partial(data->buffer, data->contents.array[at].array[data->select], delimits_content, main->output.to.stream);
+            }
 
             if ((data->option & fss_extended_read_data_option_original_d) && data->quotes_content.array[at].array[data->select]) {
+              content_printed = F_true;
+
               f_print_dynamic_raw(
                 data->quotes_content.array[at].array[data->select] == f_fss_quote_type_single_e
                   ? f_fss_quote_single_s
@@ -113,9 +119,9 @@ extern "C" {
               continue;
             }
 
-            content_printed = F_true;
-
             if ((data->option & fss_extended_read_data_option_original_d) && data->quotes_content.array[at].array[i]) {
+              content_printed = F_true;
+
               f_print_dynamic_raw(
                 data->quotes_content.array[at].array[i] == f_fss_quote_type_single_e
                   ? f_fss_quote_single_s
@@ -126,9 +132,15 @@ extern "C" {
               );
             }
 
-            f_print_except_dynamic_partial(data->buffer, data->contents.array[at].array[i], delimits_content, main->output.to.stream);
+            if (data->contents.array[at].array[i].start <= data->contents.array[at].array[i].stop) {
+              content_printed = F_true;
+
+              f_print_except_dynamic_partial(data->buffer, data->contents.array[at].array[i], delimits_content, main->output.to.stream);
+            }
 
             if ((data->option & fss_extended_read_data_option_original_d) && data->quotes_content.array[at].array[i]) {
+              content_printed = F_true;
+
               f_print_dynamic_raw(
                 data->quotes_content.array[at].array[i] == f_fss_quote_type_single_e
                   ? f_fss_quote_single_s