]> 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:07:30 +0000 (20:07 -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 6b6ea0596f1a826168ffa1899d393f08441eda0f..341b550e124e4e3e58d3c75e8f48ed9e781e1905 100644 (file)
@@ -236,7 +236,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 fe7ffad7c2a0d2da3ae6eb2d4b9df7cc3a705d1f..85ad81e3d81c66032ab12f3d380da91438e10d00 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);
         }
       }