From 735278002d780733dd371466f309b11c52ac4a13 Mon Sep 17 00:00:00 2001 From: Rob Lemley Date: Tue, 1 Nov 2022 23:51:51 +0000 Subject: [PATCH] Bug 1797894 - Set gAppData->vendor to NULL when not set otherwise. r=glandium As suggested in the review for bug 1793005 (D158441). Sets gAppData->vendor to NULL when otherwise falsy without changing the value set by old-configure. There are places in the code such as BackgroundTasks.cpp from toolkit that depend on MOZ_APP_VENDOR being a string value, empty or otherwise. Differential Revision: https://phabricator.services.mozilla.com/D160651 --- build/appini_header.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build/appini_header.py b/build/appini_header.py index 08bd22721df9..4cf9481ea099 100644 --- a/build/appini_header.py +++ b/build/appini_header.py @@ -29,9 +29,9 @@ def main(output, file): for o in config.options(s) ) appdata["flags"] = " | ".join(sorted(flags)) if flags else "0" - appdata["App:profile"] = ( - '"%s"' % appdata["App:profile"] if "App:profile" in appdata else "NULL" - ) + for key in ("App:vendor", "App:profile"): + # Set to NULL when not present or falsy such as an empty string + appdata[key] = '"%s"' % appdata[key] if appdata.get(key, None) else "NULL" expected = ( "App:vendor", "App:name", @@ -63,7 +63,7 @@ def main(output, file): output.write( """#include "mozilla/XREAppData.h" static const mozilla::StaticXREAppData sAppData = { - "%(App:vendor)s", + %(App:vendor)s, "%(App:name)s", "%(App:remotingname)s", "%(App:version)s",