From 4af2f0ea2aae29d69ce904e51e6492a1394066c2 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Fri, 28 Oct 2022 20:49:15 -0500 Subject: [PATCH] Bugfix: Two 0's are printed when --total is used and there are no matching Objects. There is an optimization used that immediately prints 0 and returns if there is no matching data on load. The problem is that the caller isn't told that it should stop processing because F_none is returned. Remove the optimization rather than implementing a custom return code and changing the code to handle this. The normal code is still run and still correctly determines that there are 0 Objects. --- level_3/fss_basic_list_read/c/private-read.c | 10 +--------- level_3/fss_basic_read/c/private-read.c | 6 +----- level_3/fss_extended_list_read/c/private-read.c | 6 +----- level_3/fss_extended_read/c/private-read.c | 6 +----- level_3/fss_payload_read/c/private-read.c | 10 +--------- 5 files changed, 5 insertions(+), 33 deletions(-) diff --git a/level_3/fss_basic_list_read/c/private-read.c b/level_3/fss_basic_list_read/c/private-read.c index a106622..1025f6e 100644 --- a/level_3/fss_basic_list_read/c/private-read.c +++ b/level_3/fss_basic_list_read/c/private-read.c @@ -261,15 +261,7 @@ extern "C" { } if (status == F_data_not_stop || status == F_data_not_eos) { - if (data->option & fss_basic_list_read_data_option_total_d) { - f_file_stream_lock(main->output.to); - - fss_basic_list_read_print_zero(main); - - f_file_stream_unlock(main->output.to); - - return F_none; - } + if (data->option & fss_basic_list_read_data_option_total_d) return F_none; return F_status_set_warning(status); } diff --git a/level_3/fss_basic_read/c/private-read.c b/level_3/fss_basic_read/c/private-read.c index 57231a2..255777f 100644 --- a/level_3/fss_basic_read/c/private-read.c +++ b/level_3/fss_basic_read/c/private-read.c @@ -246,11 +246,7 @@ extern "C" { } if (status == F_data_not_stop || status == F_data_not_eos) { - if (data->option & fss_basic_read_data_option_total_d) { - fss_basic_read_print_zero(main); - - return F_none; - } + if (data->option & fss_basic_read_data_option_total_d) return F_none; return F_status_set_warning(status); } diff --git a/level_3/fss_extended_list_read/c/private-read.c b/level_3/fss_extended_list_read/c/private-read.c index da2b8fa..1676b4b 100644 --- a/level_3/fss_extended_list_read/c/private-read.c +++ b/level_3/fss_extended_list_read/c/private-read.c @@ -262,11 +262,7 @@ extern "C" { } if (status == F_data_not_stop || status == F_data_not_eos) { - if (data->option & fss_extended_list_read_data_option_total_d) { - fss_extended_list_read_print_zero(main); - - return F_none; - } + if (data->option & fss_extended_list_read_data_option_total_d) return F_none; return F_status_set_warning(status); } diff --git a/level_3/fss_extended_read/c/private-read.c b/level_3/fss_extended_read/c/private-read.c index cefe7c9..f0796bc 100644 --- a/level_3/fss_extended_read/c/private-read.c +++ b/level_3/fss_extended_read/c/private-read.c @@ -268,11 +268,7 @@ extern "C" { } if (status == F_data_not_stop || status == F_data_not_eos) { - if (data->option & fss_extended_read_data_option_total_d) { - fss_extended_read_print_zero(main); - - return F_none; - } + if (data->option & fss_extended_read_data_option_total_d) return F_none; return F_status_set_warning(status); } diff --git a/level_3/fss_payload_read/c/private-read.c b/level_3/fss_payload_read/c/private-read.c index fa9b6ef..069f61b 100644 --- a/level_3/fss_payload_read/c/private-read.c +++ b/level_3/fss_payload_read/c/private-read.c @@ -271,15 +271,7 @@ extern "C" { } if (status == F_data_not_stop || status == F_data_not_eos) { - if (data->option & fss_payload_read_data_option_total_d) { - f_file_stream_lock(main->output.to); - - fss_payload_read_print_zero(main); - - f_file_stream_unlock(main->output.to); - - return F_none; - } + if (data->option & fss_payload_read_data_option_total_d) return F_none; return F_status_set_warning(status); } -- 1.8.3.1