From 2655d001af6bd7a62b3d72f762adc6b6895ad57b Mon Sep 17 00:00:00 2001 From: "benjamin%smedbergs.us" Date: Tue, 18 Jul 2006 17:00:37 +0000 Subject: [PATCH] Bug 317839 sr=bryner Favicon service Original committer: brettw%gmail.com Original revision: 1.8 Original date: 2005/12/12 20:03:33 --- toolkit/components/places/src/nsNavHistoryQuery.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/toolkit/components/places/src/nsNavHistoryQuery.cpp b/toolkit/components/places/src/nsNavHistoryQuery.cpp index b17e0f4f4fb..8e86d0f794b 100644 --- a/toolkit/components/places/src/nsNavHistoryQuery.cpp +++ b/toolkit/components/places/src/nsNavHistoryQuery.cpp @@ -346,8 +346,14 @@ FreeTokenList(nsVoidArray* aTokens) nsresult TokenizeQueryString(const nsACString& aQuery, nsVoidArray* aTokens) { - // Strip of the "place:" prefix - const nsCSubstring &query = Substring(aQuery, strlen("place:")); + // Strip off the "place:" prefix + const PRUint32 prefixlen = 6; // = strlen("place:"); + nsCString query; + if (aQuery.Length() > prefixlen && + Substring(aQuery, 0, prefixlen).EqualsLiteral("place:")) + query = Substring(aQuery, prefixlen); + else + query = aQuery; PRInt32 keyFirstIndex = 0; PRInt32 equalsIndex = 0;