From 64583c563677dddcd9c28bb38afd104f8c37ce68 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Sat, 24 Oct 2020 18:45:22 -0500 Subject: [PATCH] Update: print the open/closing for the FSS Basic List Read and FSS Extended List Read. When both -o/--object and -c/--content parameters are specified, print the relevant open and close parts. --- .../c/private-fss_basic_list_read.c | 7 +++++- .../c/private-fss_extended_list_read.c | 26 ++++++++++++++++------ 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/level_3/fss_basic_list_read/c/private-fss_basic_list_read.c b/level_3/fss_basic_list_read/c/private-fss_basic_list_read.c index 1e1783a..9105126 100644 --- a/level_3/fss_basic_list_read/c/private-fss_basic_list_read.c +++ b/level_3/fss_basic_list_read/c/private-fss_basic_list_read.c @@ -588,7 +588,12 @@ extern "C" { fprintf(data.output.stream, "%c", fss_basic_list_read_pipe_content_start); } else { - fprintf(data.output.stream, "%c", f_fss_eol); + if (data.parameters[fss_basic_list_read_parameter_content].result == f_console_result_found) { + fprintf(data.output.stream, "%c%c", f_fss_basic_list_open, f_fss_basic_list_open_end); + } + else { + fprintf(data.output.stream, "%c", f_fss_eol); + } } } #endif // _di_fss_basic_list_read_print_object_end_ diff --git a/level_3/fss_extended_list_read/c/private-fss_extended_list_read.c b/level_3/fss_extended_list_read/c/private-fss_extended_list_read.c index cd4286b..04dc532 100644 --- a/level_3/fss_extended_list_read/c/private-fss_extended_list_read.c +++ b/level_3/fss_extended_list_read/c/private-fss_extended_list_read.c @@ -471,10 +471,7 @@ extern "C" { if (items->array[i].content.used > 0) { f_print_except_dynamic_partial(data->output.stream, data->buffer, items->array[i].content.array[0], *contents_delimits); - - if (data->parameters[fss_extended_list_read_parameter_pipe].result == f_console_result_found) { - fprintf(data->output.stream, "%c", fss_extended_list_read_pipe_content_end); - } + fss_extended_list_read_print_content_end(*data); } else if (include_empty) { fss_extended_list_read_print_set_end(*data); @@ -803,7 +800,12 @@ extern "C" { fprintf(data.output.stream, "%c", fss_extended_list_read_pipe_content_start); } else { - fprintf(data.output.stream, "%c", f_fss_eol); + if (data.parameters[fss_extended_list_read_parameter_content].result == f_console_result_found) { + fprintf(data.output.stream, "%c%c", f_fss_extended_list_open, f_fss_extended_list_open_end); + } + else { + fprintf(data.output.stream, "%c", f_fss_eol); + } } } #endif // _di_fss_extended_list_read_print_object_end_ @@ -815,7 +817,12 @@ extern "C" { fprintf(data.output.stream, "%c", fss_extended_list_read_pipe_content_start); } else { - fprintf(data.output.stream, "%c", f_fss_eol); + if (data.parameters[fss_extended_list_read_parameter_object].result == f_console_result_found) { + fprintf(data.output.stream, "%c%c", f_fss_extended_list_close, f_fss_extended_list_close_end); + } + else { + fprintf(data.output.stream, "%c", f_fss_eol); + } } } #endif // _di_fss_extended_list_read_print_content_end_ @@ -836,7 +843,12 @@ extern "C" { fprintf(data.output.stream, "%c", fss_extended_list_read_pipe_content_end); } else { - fprintf(data.output.stream, "%c", f_fss_eol); + if (data.parameters[fss_extended_list_read_parameter_object].result == f_console_result_found) { + fprintf(data.output.stream, "%c%c", f_fss_extended_list_close, f_fss_extended_list_close_end); + } + else { + fprintf(data.output.stream, "%c", f_fss_eol); + } } } #endif // _di_fss_extended_list_read_print_set_end_ -- 1.8.3.1