From 8738012f43a1a6c2156ccb92f55bda998f2e6bc2 Mon Sep 17 00:00:00 2001 From: Chris Roberts Date: Sat, 11 Jan 2025 16:30:52 -0700 Subject: [PATCH] rc: fix app_version handling during decompile The length of the BeOS resource is twice as long because it contains additional system info. For resources compiled with the Haiku version of rc we can compare the length with a single sizeof(version_info) Change-Id: Ia0c243434a5dd5792d0b97e7baecdfaf6b4027be Reviewed-on: https://review.haiku-os.org/c/haiku/+/8827 Haiku-Format: Haiku-format Bot Reviewed-by: waddlesplash Tested-by: Commit checker robot --- src/bin/rc/decompile.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/bin/rc/decompile.cpp b/src/bin/rc/decompile.cpp index 68a6de5349..57420eaa9d 100644 --- a/src/bin/rc/decompile.cpp +++ b/src/bin/rc/decompile.cpp @@ -900,7 +900,10 @@ write_data(int32 id, const char *name, type_code type, break; case 'APPV': - if (!strcmp(name, "BEOS:APP_VERSION") && length == sizeof(version_info) * 2) { + if (!strcmp(name, "BEOS:APP_VERSION") + && (length == sizeof(version_info) + // length can be twice the size for the old BeOS resource + || length == sizeof(version_info) * 2)) { write_app_version(data, length); return; }