]> 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:49:15 +0000 (20:49 -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 d327877c442ade249e55b6e5b589460b038bfc2d..5b7e6f4732dc559880abdc4262bdfcabb2193d0a 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) {
-        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);
     }
index 28760fc896bf7a208a8ec90f6ee3f8fe4d36644c..613f03b598acb15da6d703c1d0263a4c2d5ec8cb 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 1da5a70d7cd6b06a8015335cc8c809b8d1a56127..b53cf556a86df2dcc02679f56834644ce9f0ff5a 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 d4f79509f046238085dd2cd221b654329d6e69f2..f304972cfe564ded31a824a3cb1bb6ed65f79ecf 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 36e0da4e49c468a4f76a43d6d003c48640c95afb..2a52585d0cba7403ee63790c2c4f4f05a3cf3f18 100644 (file)
@@ -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);
     }