From dbef2eb1b5f6c7b683d7b7619903ee1dac67ca20 Mon Sep 17 00:00:00 2001 From: "radha%netscape.com" Date: Wed, 27 Sep 2000 21:27:35 +0000 Subject: [PATCH] Fix for bugscape bug # 1644. keywords work eventhough the pref for it is turned off. r=valeski a=mscott git-svn-id: svn://10.0.0.236/trunk@80016 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/docshell/base/nsWebShell.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mozilla/docshell/base/nsWebShell.cpp b/mozilla/docshell/base/nsWebShell.cpp index d28ac28ad12..607d8924b22 100644 --- a/mozilla/docshell/base/nsWebShell.cpp +++ b/mozilla/docshell/base/nsWebShell.cpp @@ -1005,6 +1005,7 @@ nsWebShell::OnEndDocumentLoad(nsIDocumentLoader* loader, NS_ERROR_FAILURE); // we should only perform a keyword search under the following conditions: + // (0) Pref keyword.enabled is true // (1) the url scheme is http (or https) // (2) the url does not have a protocol scheme // If we don't enforce such a policy, then we end up doing keyword searchs on urls @@ -1014,10 +1015,10 @@ nsWebShell::OnEndDocumentLoad(nsIDocumentLoader* loader, // if we want keywords enabled...this is just a bandaid... static const char httpSchemeName[] = "http"; - if (schemeStr.IsEmpty() || !schemeStr.Find(httpSchemeName) ) - keywordsEnabled = PR_TRUE; // keep keywors enabled for this url - else - keywordsEnabled = PR_FALSE; // all other cases, disable keywords for this url. + if (keywordsEnabled) { + if (!schemeStr.IsEmpty() && ((schemeStr.Find(httpSchemeName)) != 0)) + keywordsEnabled = PR_FALSE; + } if(keywordsEnabled && (-1 == dotLoc)) {