From 8c31a369abe5655e1ad601bafa4dc1df4ddc7e4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Mon, 5 Feb 2007 23:28:09 +0000 Subject: [PATCH] Now sets the "other" unchanged version info to {0} if it doesn't exist yet - this should work around bug #681 on R5. Please test. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20076 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/bin/setversion.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/bin/setversion.cpp b/src/bin/setversion.cpp index 1d5be50ebe..9b53ca6c97 100644 --- a/src/bin/setversion.cpp +++ b/src/bin/setversion.cpp @@ -1,6 +1,6 @@ /* * Copyright 2002, Ryan Fleet. - * Copyright 2006, Axel Dörfler, axeld@pinc-software.de. + * Copyright 2006-2007, Axel Dörfler, axeld@pinc-software.de. * * Distributed under the terms of the MIT license. */ @@ -332,6 +332,18 @@ main(int argc, char *argv[]) if (status != B_OK) errorOut(status, argv[1], false); + if (systemModified ^ appModified) { + // clear out other app info if not present - this works around a + // bug in BeOS, see bug #681. + version_kind kind = systemModified ? B_APP_VERSION_KIND : B_SYSTEM_VERSION_KIND; + version_info clean; + + if (info.GetVersionInfo(&clean, kind) != B_OK) { + memset(&clean, 0, sizeof(version_info)); + info.SetVersionInfo(&clean, kind); + } + } + if (appModified) { status = info.SetVersionInfo(&appVersion, B_APP_VERSION_KIND); if (status < B_OK)