]> Kevux Git Server - fll/commitdiff
Regression: Improper execution when no arguments and no pipe are passed to fake.
authorKevin Day <thekevinday@gmail.com>
Wed, 23 Nov 2022 02:03:31 +0000 (20:03 -0600)
committerKevin Day <thekevinday@gmail.com>
Wed, 23 Nov 2022 02:03:31 +0000 (20:03 -0600)
At some point in time the default for executing without a "clean", "make", or "build" stopped working.
This probably happened when I fixed the empty pipe bug.

The default should run the "make" operation.

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

index b3f7a9a4da4d5a154cc9eeafbb26c76bd6823154..084fc907a7a11f7f0bb7275606174068c7034178 100644 (file)
@@ -339,7 +339,7 @@ extern "C" {
         }
 
         // Pre-process and perform validation when "clean" is before a "build" or "make" command as a safety check.
-        if (operations_length > 1) {
+        if (operations_length) {
           for (uint8_t has_clean = F_false; i < operations_length; ++i) {
 
             if (operations[i] == fake_operation_clean_e) {
index 51c0707f06cc91ac4930cd19742b46113b50884a..1fdf9fec8e61fd47a35184917554ce3c0e5f5a43 100644 (file)
@@ -96,7 +96,7 @@ extern "C" {
     if (build_arguments && build_arguments->used) {
       path_file.used = data->path_data_build.used + build_arguments->array[0].used;
     }
-    else if (data->flag & fake_data_flag_has_operation_e) {
+    else if (!process_pipe || (data->flag & fake_data_flag_has_operation_e)) {
       path_file.used = data->file_data_build_settings.used;
     }
     else {
@@ -111,7 +111,7 @@ extern "C" {
       memcpy(path_file_string, data->path_data_build.string, sizeof(f_char_t) * data->path_data_build.used);
       memcpy(path_file_string + data->path_data_build.used, build_arguments->array[0].string, sizeof(f_char_t) * build_arguments->array[0].used);
     }
-    else if (data->flag & fake_data_flag_has_operation_e) {
+    else if (!process_pipe || (data->flag & fake_data_flag_has_operation_e)) {
       memcpy(path_file_string, data->file_data_build_settings.string, sizeof(f_char_t) * data->file_data_build_settings.used);
     }
     else {
@@ -135,7 +135,7 @@ extern "C" {
       }
 
       if (F_status_is_error_not(*status)) {
-        if (build_arguments && build_arguments->used || (data->flag & fake_data_flag_has_operation_e)) {
+        if (build_arguments && build_arguments->used || !process_pipe || (data->flag & fake_data_flag_has_operation_e)) {
           *status = fake_file_buffer(data, path_file, process_pipe ? F_false : F_true, &buffer);
         }
       }