From: Kevin Day Date: Sat, 29 Oct 2022 01:49:15 +0000 (-0500) Subject: Bugfix: Two 0's are printed when --total is used and there are no matching Objects. X-Git-Tag: 0.6.1~1 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=5a62de128aca5440c1149dd8621440fabcfa3ae3;p=fll 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. --- 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 d327877..5b7e6f4 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) { - flockfile(main->output.to.stream); - - fss_basic_list_read_print_zero(main); - - funlockfile(main->output.to.stream); - - 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 28760fc..613f03b 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 1da5a70..b53cf55 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 d4f7950..f304972 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 36e0da4..2a52585 100644 --- a/level_3/fss_payload_read/c/private-read.c +++ b/level_3/fss_payload_read/c/private-read.c @@ -277,15 +277,7 @@ extern "C" { } if (status == F_data_not_stop || status == F_data_not_eos) { - if (data->option & fss_payload_read_data_option_total_d) { - flockfile(main->output.to.stream); - - fss_payload_read_print_zero(main); - - funlockfile(main->output.to.stream); - - return F_none; - } + if (data->option & fss_payload_read_data_option_total_d) return F_none; return F_status_set_warning(status); }