diff --git a/mailnews/base/util/nsMsgUtils.cpp b/mailnews/base/util/nsMsgUtils.cpp index 9409fd5586..a25f277c44 100644 --- a/mailnews/base/util/nsMsgUtils.cpp +++ b/mailnews/base/util/nsMsgUtils.cpp @@ -2105,10 +2105,10 @@ NS_MSG_BASE nsMsgKey msgKeyFromInt(uint64_t aValue) } // Helper function to extract a query qualifier. -nsAutoCString MsgExtractQueryPart(nsAutoCString spec, const char* queryToExtract) +nsCString MsgExtractQueryPart(const nsACString& spec, const char* queryToExtract) { - nsAutoCString queryPart; - int32_t queryIndex = spec.Find(queryToExtract); + nsCString queryPart; + int32_t queryIndex = nsPromiseFlatCString(spec).Find(queryToExtract); if (queryIndex == kNotFound) return queryPart; diff --git a/mailnews/base/util/nsMsgUtils.h b/mailnews/base/util/nsMsgUtils.h index 1920ba780d..455897d129 100644 --- a/mailnews/base/util/nsMsgUtils.h +++ b/mailnews/base/util/nsMsgUtils.h @@ -372,7 +372,7 @@ NS_MSG_BASE nsMsgKey msgKeyFromInt(uint64_t aValue); /** * Helper function to extract query part from URL spec. */ -nsAutoCString MsgExtractQueryPart(nsAutoCString spec, const char* queryToExtract); +nsCString MsgExtractQueryPart(const nsACString& spec, const char* queryToExtract); /** * Helper macro for defining getter/setters. Ported from nsISupportsObsolete.h diff --git a/mailnews/imap/src/nsImapProtocol.cpp b/mailnews/imap/src/nsImapProtocol.cpp index d238788478..ae8faa281e 100644 --- a/mailnews/imap/src/nsImapProtocol.cpp +++ b/mailnews/imap/src/nsImapProtocol.cpp @@ -9361,7 +9361,7 @@ nsresult nsImapMockChannel::OpenCacheEntry() // ?section=2?part=1.2&filename=A01.JPG&type=image/jpeg&filename=A01.JPG // ?part=1.2&type=image/jpeg&filename=IMG_C0030.jpg // ?header=quotebody&part=1.2&filename=lijbmghmkilicioj.png - nsAutoCString partQuery = MsgExtractQueryPart(path, "?part="); + nsCString partQuery = MsgExtractQueryPart(path, "?part="); if (partQuery.IsEmpty()) { partQuery = MsgExtractQueryPart(path, "&part="); if (!partQuery.IsEmpty()) { @@ -9369,7 +9369,7 @@ nsresult nsImapMockChannel::OpenCacheEntry() partQuery.SetCharAt('?', 0); } } - nsAutoCString filenameQuery = MsgExtractQueryPart(path, "&filename="); + nsCString filenameQuery = MsgExtractQueryPart(path, "&filename="); // Truncate path at either /; or ? int32_t ind = path.FindChar('?'); diff --git a/mailnews/jsaccount/src/JaUrl.cpp b/mailnews/jsaccount/src/JaUrl.cpp index f103460c66..21b1163fea 100644 --- a/mailnews/jsaccount/src/JaUrl.cpp +++ b/mailnews/jsaccount/src/JaUrl.cpp @@ -108,7 +108,7 @@ NS_IMETHODIMP JaBaseCppUrl::GetPrincipalSpec(nsACString& aPrincipalSpec) nsAutoCString spec; mailnewsURL->GetSpecIgnoringRef(spec); - nsAutoCString queryPart = MsgExtractQueryPart(spec, "number="); + nsCString queryPart = MsgExtractQueryPart(spec, "number="); // Strip any query part beginning with ? or /; int32_t ind = spec.Find("/;");