From e56532f73ee1c9092351eb43d14d451d7427212b Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Tue, 22 Nov 2022 20:03:31 -0600 Subject: [PATCH] Regression: Improper execution when no arguments and no pipe are passed to fake. 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 | 2 +- level_3/fake/c/private-build-load.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/level_3/fake/c/fake.c b/level_3/fake/c/fake.c index b3f7a9a..084fc90 100644 --- a/level_3/fake/c/fake.c +++ b/level_3/fake/c/fake.c @@ -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) { diff --git a/level_3/fake/c/private-build-load.c b/level_3/fake/c/private-build-load.c index 51c0707..1fdf9fe 100644 --- a/level_3/fake/c/private-build-load.c +++ b/level_3/fake/c/private-build-load.c @@ -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); } } -- 1.8.3.1