From ddd5fb88b66ea38ff12c1532dba77b9f6650fb77 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Tue, 14 Dec 2021 20:23:57 -0600 Subject: [PATCH] Update: Reset fakefile buffer and only call resize when necessary. --- level_3/fake/c/private-make.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/level_3/fake/c/private-make.c b/level_3/fake/c/private-make.c index d75f953..cf86a9f 100644 --- a/level_3/fake/c/private-make.c +++ b/level_3/fake/c/private-make.c @@ -203,6 +203,8 @@ extern "C" { return; } + data_make->fakefile.used = 0; + *status = fake_file_buffer(main, main->file_data_build_fakefile.string, &data_make->buffer); if (F_status_is_error(*status)) return; @@ -270,7 +272,9 @@ extern "C" { const f_string_range_t name_settings_range = macro_f_string_range_t_initialize(fake_make_section_settings_s_length); const f_string_range_t name_main_range = macro_f_string_range_t_initialize(fake_make_section_main_s_length); - macro_f_fss_nameds_t_resize((*status), data_make->fakefile, list_objects.used); + if (list_objects.used > data_make->fakefile.size) { + macro_f_fss_nameds_t_resize((*status), data_make->fakefile, list_objects.used); + } if (F_status_is_error(*status)) { fll_error_print(main->error, F_status_set_fine(*status), "macro_f_fss_nameds_t_resize", F_true); -- 1.8.3.1