]> Kevux Git Server - fll/commitdiff
Bugfix: fss read programs should return 0 on invalid/empty files when --total is...
authorKevin Day <thekevinday@gmail.com>
Sun, 27 Sep 2020 02:06:22 +0000 (21:06 -0500)
committerKevin Day <thekevinday@gmail.com>
Sun, 27 Sep 2020 02:06:22 +0000 (21:06 -0500)
level_3/fss_basic_list_read/c/fss_basic_list_read.c
level_3/fss_basic_list_read/c/private-fss_basic_list_read.c
level_3/fss_basic_read/c/fss_basic_read.c
level_3/fss_basic_read/c/private-fss_basic_read.c
level_3/fss_extended_list_read/c/fss_extended_list_read.c
level_3/fss_extended_list_read/c/private-fss_extended_list_read.c
level_3/fss_extended_read/c/fss_extended_read.c
level_3/fss_extended_read/c/private-fss_extended_read.c

index c067b833d90e5725b69d799172533846f92325a5..8eab6b826b8399771ed77a6f64c78bd193667eda 100644 (file)
@@ -372,6 +372,10 @@ extern "C" {
 
             // Skip past empty files.
             if (!data->quantity.total) {
+              if (data->parameters[fss_basic_list_read_parameter_total].result == f_console_result_found) {
+                fprintf(f_type_output, "0%c", f_string_eol[0]);
+              }
+
               f_file_stream_close(F_true, &file);
               continue;
             }
index e8f4f1ddaedefef3067732b257d4ba11396bfbd9..fcc333d228c2b6daac89a47a51514a47eb1c1338 100644 (file)
@@ -217,6 +217,11 @@ extern "C" {
         return F_status_set_error(status);
       }
       else if (status == F_data_not_stop || status == F_data_not_eos) {
+        if (data->parameters[fss_basic_list_read_parameter_total].result == f_console_result_found) {
+          fprintf(f_type_output, "0%c", f_string_eol[0]);
+          return F_none;
+        }
+
         // Clear buffers, then attempt the next file.
         f_macro_fss_contents_t_delete_simple(data->contents);
         f_macro_fss_objects_t_delete_simple(data->objects);
index 8eb01bfb1c2ccdfc392dfe33817dd4d1c98369dc..ba092b1c3d6a8c3774bee6bdd590cf9c464b1cf9 100644 (file)
@@ -372,6 +372,10 @@ extern "C" {
 
             // Skip past empty files.
             if (!data->quantity.total) {
+              if (data->parameters[fss_basic_read_parameter_total].result == f_console_result_found) {
+                fprintf(f_type_output, "0%c", f_string_eol[0]);
+              }
+
               f_file_stream_close(F_true, &file);
               continue;
             }
index 10292f62b7acba7326e112ea311fa51b8ca98288..bdcb72f98902cf0be719ce6278f3f2ff9bd6ab15 100644 (file)
@@ -217,6 +217,10 @@ extern "C" {
         return F_status_set_error(status);
       }
       else if (status == F_data_not_stop || status == F_data_not_eos) {
+        if (data->parameters[fss_basic_read_parameter_total].result == f_console_result_found) {
+          fprintf(f_type_output, "0%c", f_string_eol[0]);
+          return F_none;
+        }
 
         // Clear buffers, then attempt the next file.
         f_macro_fss_contents_t_delete_simple(data->contents);
index ae48f280c2269247ccd050455c3ad8d6967441f0..991629318e52d6ac4e61f8d6468ae7cb8e225bbf 100644 (file)
@@ -356,6 +356,10 @@ extern "C" {
 
             // Skip past empty files.
             if (!data->quantity.total) {
+              if (data->parameters[fss_extended_list_read_parameter_total].result == f_console_result_found) {
+                fprintf(f_type_output, "0%c", f_string_eol[0]);
+              }
+
               f_file_stream_close(F_true, &file);
               continue;
             }
index 13254ae2cd603e04400f54e68594940f84b075ce..29455b66c56f970f8cbd625f747dcde3a5a76942 100644 (file)
@@ -217,6 +217,11 @@ extern "C" {
         return F_status_set_error(status);
       }
       else if (status == F_data_not_stop || status == F_data_not_eos) {
+        if (data->parameters[fss_extended_list_read_parameter_total].result == f_console_result_found) {
+          fprintf(f_type_output, "0%c", f_string_eol[0]);
+          return F_none;
+        }
+
         // Clear buffers, then attempt the next file.
         f_macro_fss_nest_t_delete_simple(data->nest);
         f_macro_string_dynamic_t_delete_simple(data->buffer);
index 5283a59c4ab0db096035328653b2247c5429fd62..8354d77a57734fb46a7f8b14cedad96da1327f5d 100644 (file)
@@ -373,6 +373,10 @@ extern "C" {
 
             // Skip past empty files.
             if (!data->quantity.total) {
+              if (data->parameters[fss_extended_read_parameter_total].result == f_console_result_found) {
+                fprintf(f_type_output, "0%c", f_string_eol[0]);
+              }
+
               f_file_stream_close(F_true, &file);
               continue;
             }
index 621ba897d8d0acb0e4cc52f5c0f0dc1da1c101d6..294ec9aafc9efb2ef63ea29cd3b41a04dd6bccc4 100644 (file)
@@ -217,6 +217,10 @@ extern "C" {
         return F_status_set_error(status);
       }
       else if (status == F_data_not_stop || status == F_data_not_eos) {
+        if (data->parameters[fss_extended_read_parameter_total].result == f_console_result_found) {
+          fprintf(f_type_output, "0%c", f_string_eol[0]);
+          return F_none;
+        }
 
         // Clear buffers, then attempt the next file.
         f_macro_fss_contents_t_delete_simple(data->contents);