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 <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
This commit is contained in:
Chris Roberts 2025-01-11 16:30:52 -07:00 committed by waddlesplash
parent 08028803b1
commit 8738012f43

View File

@ -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;
}