From 368912e7d108ea272a4861322afdb03198b16d94 Mon Sep 17 00:00:00 2001 From: "neil%parkwaycc.co.uk" Date: Fri, 10 Oct 2003 18:05:18 +0000 Subject: [PATCH] supplementary patch to the fix to bug 209532 to fix the case when the prefs are empty or unset r/sr=darin --- netwerk/protocol/http/src/nsHttpHandler.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/netwerk/protocol/http/src/nsHttpHandler.cpp b/netwerk/protocol/http/src/nsHttpHandler.cpp index 641bd08c68ea..58ef45872b81 100644 --- a/netwerk/protocol/http/src/nsHttpHandler.cpp +++ b/netwerk/protocol/http/src/nsHttpHandler.cpp @@ -596,10 +596,6 @@ void nsHttpHandler::InitUserAgentComponents() { - // Gather Application name and Version. - mAppName.Adopt(nsCRT::strdup(UA_APPNAME)); - mAppVersion.Adopt(nsCRT::strdup(UA_APPVERSION)); - // Gather platform. mPlatform.Adopt(nsCRT::strdup( #if defined(MOZ_WIDGET_PHOTON) @@ -710,11 +706,15 @@ nsHttpHandler::PrefsChanged(nsIPrefBranch *prefs, const char *pref) if (PREF_CHANGED(UA_PREF("appName"))) { prefs->GetCharPref(UA_PREF("appName"), getter_Copies(mAppName)); + if (mAppName.IsEmpty()) + mAppName.Adopt(nsCRT::strdup(UA_APPNAME)); mUserAgentIsDirty = PR_TRUE; } if (PREF_CHANGED(UA_PREF("appVersion"))) { prefs->GetCharPref(UA_PREF("appVersion"), getter_Copies(mAppVersion)); + if (mAppVersion.IsEmpty()) + mAppVersion.Adopt(nsCRT::strdup(UA_APPVERSION)); mUserAgentIsDirty = PR_TRUE; }