]> Kevux Git Server - fll/commitdiff
Bugfix: Two 0's are printed when --total is used and there are no matching Objects.
authorKevin Day <thekevinday@gmail.com>
Sat, 29 Oct 2022 01:49:15 +0000 (20:49 -0500)
committerKevin Day <thekevinday@gmail.com>
Sat, 29 Oct 2022 01:54:19 +0000 (20:54 -0500)
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
level_3/fss_basic_read/c/private-read.c
level_3/fss_extended_list_read/c/private-read.c
level_3/fss_extended_read/c/private-read.c
level_3/fss_payload_read/c/private-read.c

index a106622df09b14b765b690a503f9ef52d41218d1..1025f6e71e58cb5f907a4fb5a13bbd67a6400e42 100644 (file)
@@ -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);
     }
index 57231a20f58c2e7431915b77d2dcccce84d50b67..255777f9dbd2e18c55cc3fbe73487fc37caa11e5 100644 (file)
@@ -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);
     }
index da2b8fa95f1f8ad68f5c60c49686d8cbc64e9200..1676b4bc01cafe043beccf6682370554bd510636 100644 (file)
@@ -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);
     }
index cefe7c9be3c4db291d55295e0a9ffb9cd5561017..f0796bc999ed5046cfffe3cd8a3694cfdb1ed995 100644 (file)
@@ -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);
     }
index fa9b6efffbf0a7528df1653fef54f2980d660ca5..069f61b1f1ad49342bacd33dea4fe459feca5bc8 100644 (file)
@@ -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);
     }