From: Kevin Day Date: Wed, 23 Jun 2021 02:57:47 +0000 (-0500) Subject: Bugfix: Properly build version string. X-Git-Tag: 0.5.4~10 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=27cceafe567802ee9af2c64f332c0003e0028142;p=fll Bugfix: Properly build version string. The previous commit didn't properly to this. When a version prefix is provided, the resulting name overwrites the string with the nano version at the wrong location in the string. --- diff --git a/level_3/fake/c/private-build.c b/level_3/fake/c/private-build.c index f3d2d9f..0e8ca4a 100644 --- a/level_3/fake/c/private-build.c +++ b/level_3/fake/c/private-build.c @@ -930,55 +930,94 @@ extern "C" { } } - count += fake_build_parameter_library_name_suffix_shared_length; - if (parameter_file_name_major_length) { + count += fake_build_parameter_library_name_suffix_shared_length; + if (data_build.setting.version_major_prefix.used) { memcpy(parameter_file_name_major + count, data_build.setting.version_major_prefix.string, data_build.setting.version_major_prefix.used); - memcpy(parameter_file_name_minor + count, data_build.setting.version_major_prefix.string, data_build.setting.version_major_prefix.used); - memcpy(parameter_file_name_micro + count, data_build.setting.version_major_prefix.string, data_build.setting.version_major_prefix.used); - memcpy(parameter_file_name_nano + count, data_build.setting.version_major_prefix.string, data_build.setting.version_major_prefix.used); + + if (parameter_file_name_minor_length) { + memcpy(parameter_file_name_minor + count, data_build.setting.version_major_prefix.string, data_build.setting.version_major_prefix.used); + + if (parameter_file_name_micro_length) { + memcpy(parameter_file_name_micro + count, data_build.setting.version_major_prefix.string, data_build.setting.version_major_prefix.used); + + if (parameter_file_name_nano_length) { + memcpy(parameter_file_name_nano + count, data_build.setting.version_major_prefix.string, data_build.setting.version_major_prefix.used); + } + } + } + count += data_build.setting.version_major_prefix.used; } memcpy(parameter_file_name_major + count, data_build.setting.version_major.string, data_build.setting.version_major.used); - memcpy(parameter_file_name_minor + count, data_build.setting.version_major.string, data_build.setting.version_major.used); - memcpy(parameter_file_name_micro + count, data_build.setting.version_major.string, data_build.setting.version_major.used); - memcpy(parameter_file_name_nano + count, data_build.setting.version_major.string, data_build.setting.version_major.used); - count += data_build.setting.version_major.used; if (parameter_file_name_minor_length) { + memcpy(parameter_file_name_minor + count, data_build.setting.version_major.string, data_build.setting.version_major.used); + + if (parameter_file_name_micro_length) { + memcpy(parameter_file_name_micro + count, data_build.setting.version_major.string, data_build.setting.version_major.used); + + if (parameter_file_name_nano_length) { + memcpy(parameter_file_name_nano + count, data_build.setting.version_major.string, data_build.setting.version_major.used); + } + } + } + + if (parameter_file_name_minor_length) { + count += data_build.setting.version_major.used; + if (data_build.setting.version_minor_prefix.used) { memcpy(parameter_file_name_minor + count, data_build.setting.version_minor_prefix.string, data_build.setting.version_minor_prefix.used); - memcpy(parameter_file_name_micro + count, data_build.setting.version_minor_prefix.string, data_build.setting.version_minor_prefix.used); - memcpy(parameter_file_name_nano + count, data_build.setting.version_minor_prefix.string, data_build.setting.version_minor_prefix.used); + + if (parameter_file_name_micro_length) { + memcpy(parameter_file_name_micro + count, data_build.setting.version_minor_prefix.string, data_build.setting.version_minor_prefix.used); + + if (parameter_file_name_nano_length) { + memcpy(parameter_file_name_nano + count, data_build.setting.version_minor_prefix.string, data_build.setting.version_minor_prefix.used); + } + } + count += data_build.setting.version_minor_prefix.used; } memcpy(parameter_file_name_minor + count, data_build.setting.version_minor.string, data_build.setting.version_minor.used); - memcpy(parameter_file_name_micro + count, data_build.setting.version_minor.string, data_build.setting.version_minor.used); - memcpy(parameter_file_name_nano + count, data_build.setting.version_minor.string, data_build.setting.version_minor.used); - count += data_build.setting.version_minor.used; if (parameter_file_name_micro_length) { + memcpy(parameter_file_name_micro + count, data_build.setting.version_minor.string, data_build.setting.version_minor.used); + + if (parameter_file_name_nano_length) { + memcpy(parameter_file_name_nano + count, data_build.setting.version_minor.string, data_build.setting.version_minor.used); + } + } + + if (parameter_file_name_micro_length) { + count += data_build.setting.version_minor.used; + if (data_build.setting.version_micro_prefix.used) { memcpy(parameter_file_name_micro + count, data_build.setting.version_micro_prefix.string, data_build.setting.version_micro_prefix.used); - memcpy(parameter_file_name_nano + count, data_build.setting.version_micro_prefix.string, data_build.setting.version_micro_prefix.used); + + if (parameter_file_name_nano_length) { + memcpy(parameter_file_name_nano + count, data_build.setting.version_micro_prefix.string, data_build.setting.version_micro_prefix.used); + } + count += data_build.setting.version_micro_prefix.used; } memcpy(parameter_file_name_micro + count, data_build.setting.version_micro.string, data_build.setting.version_micro.used); - memcpy(parameter_file_name_nano + count, data_build.setting.version_micro.string, data_build.setting.version_micro.used); - count += data_build.setting.version_micro.used; if (parameter_file_name_nano_length) { + memcpy(parameter_file_name_nano + count, data_build.setting.version_micro.string, data_build.setting.version_micro.used); + + count += data_build.setting.version_micro.used; + if (data_build.setting.version_nano_prefix.used) { memcpy(parameter_file_name_nano + count, data_build.setting.version_nano_prefix.string, data_build.setting.version_nano_prefix.used); count += data_build.setting.version_nano_prefix.used; } memcpy(parameter_file_name_nano + count, data_build.setting.version_nano.string, data_build.setting.version_nano.used); - count += data_build.setting.version_nano.used; } } }