]> Kevux Git Server - fll/commitdiff
Bugfix: The -S/--sources parameter is not being correctly used.
authorKevin Day <kevin@kevux.org>
Sun, 29 Jan 2023 21:44:53 +0000 (15:44 -0600)
committerKevin Day <kevin@kevux.org>
Sun, 29 Jan 2023 21:44:53 +0000 (15:44 -0600)
The parameter is not being properly validated.
The parameter is then not being appended to the appropriate strings.
The default value is being appended to the appropriate strings.

level_3/fake/c/private-build-load.c
level_3/fake/c/private-fake.c
level_3/fake/c/private-skeleton.c

index ca4b7423124f4d1e1309bf7056516797d94ea1e1..31db7045032f227abc88e9494b65b99f39086b78 100644 (file)
@@ -932,7 +932,7 @@ extern "C" {
         fake_path_part_script_s,                     // path_program_script
         fake_path_part_shared_s,                     // path_program_shared
         fake_path_part_static_s,                     // path_program_static
-        fake_default_path_sources_s,                 // path_sources
+        f_string_empty_s,                            // path_sources
         f_string_empty_s,                            // path_sources_object
         f_string_empty_s,                            // preserve_path_headers
         f_string_empty_s,                            // process_post
index 46076abc674a593011190157720d77f06c8c230d..bb858cc4bebd897237ca6cdf7f886360e998124d 100644 (file)
@@ -361,28 +361,32 @@ extern "C" {
       const uint8_t parameters_id[] = {
         fake_parameter_path_build_e,
         fake_parameter_path_data_e,
+        fake_parameter_path_sources_e,
         fake_parameter_path_work_e,
       };
 
       const f_string_static_t parameters_name[] = {
         fake_long_path_build_s,
         fake_long_path_data_s,
+        fake_long_path_sources_s,
         fake_long_path_work_s,
       };
 
       const f_string_static_t parameter_defaults[] = {
         fake_default_path_build_s,
         fake_default_path_data_s,
+        fake_default_path_sources_s,
         fake_default_path_work_s,
       };
 
       f_string_dynamic_t * const parameters_value[] = {
         &data->path_build,
         &data->path_data,
+        &data->path_sources,
         &data->path_work,
       };
 
-      for (uint8_t i = 0; i < 3; ++i) {
+      for (uint8_t i = 0; i < 4; ++i) {
 
         if (data->main->parameters.array[parameters_id[i]].result == f_console_result_found_e) {
           fake_print_error_parameter_missing_value(data, parameters_name[i]);
@@ -557,12 +561,14 @@ extern "C" {
     const f_string_static_t names[] = {
       fake_long_path_build_s,
       fake_long_path_data_s,
+      fake_long_path_sources_s,
       fake_long_path_work_s,
     };
 
     const f_string_dynamic_t values[] = {
       data->path_build,
       data->path_data,
+      data->path_sources,
       data->path_work,
     };
 
@@ -570,8 +576,11 @@ extern "C" {
       F_false,
       data->main->process_pipe ? F_false : F_true,
       F_false,
+      F_false,
     };
 
+    struct stat directory_stat;
+
     f_status_t status = F_none;
 
     // Check only expected operations (fake_operation_clean_e and fake_operation_skeleton_e should not call this function).
@@ -609,9 +618,7 @@ extern "C" {
       }
     }
 
-    struct stat directory_stat;
-
-    for (uint8_t i = 0; i < 3; ++i) {
+    for (uint8_t i = 0; i < 4; ++i) {
 
       if (requireds[i] != F_none && values[i].used) {
         memset(&directory_stat, 0, sizeof(struct stat));
index 0e827ba541d35368e67ed0429dc9b133c75603ff..f7479ba6c17eb14e4d786453742041060b1e339c 100644 (file)
@@ -300,7 +300,7 @@ extern "C" {
 #ifndef _di_fake_skeleton_path_source_length_
   void fake_skeleton_path_source_length(fake_data_t * const data, const f_string_static_t *partial, f_string_static_t * const source) {
 
-    source->used = data->path_sources.used + fake_default_path_sources_s.used + partial->used;
+    source->used = data->path_sources.used + partial->used;
   }
 #endif // _di_fake_skeleton_path_source_length_
 
@@ -312,9 +312,6 @@ extern "C" {
     memcpy(source->string, data->path_sources.string, sizeof(f_char_t) * data->path_sources.used);
     source->used += data->path_sources.used;
 
-    memcpy(source->string, fake_default_path_sources_s.string, sizeof(f_char_t) * fake_default_path_sources_s.used);
-    source->used += fake_default_path_sources_s.used;
-
     memcpy(source->string + source->used, partial->string, sizeof(f_char_t) * partial->used);
     source->used += partial->used;