diff --git a/mozilla/content/xul/document/src/nsXULDocument.cpp b/mozilla/content/xul/document/src/nsXULDocument.cpp index 7b3d4066499..a95a8be6e41 100644 --- a/mozilla/content/xul/document/src/nsXULDocument.cpp +++ b/mozilla/content/xul/document/src/nsXULDocument.cpp @@ -2428,8 +2428,8 @@ XULDocumentImpl::SplitProperty(nsIRDFResource* aProperty, // First try to split the namespace using the rightmost '#' or '/' // character. - if ((i = uri.RFind('#')) < 0) { - if ((i = uri.RFind('/')) < 0) { + if ((i = uri.RFindChar('#')) < 0) { + if ((i = uri.RFindChar('/')) < 0) { *aNameSpaceID = kNameSpaceID_None; *aTag = NS_NewAtom(uri); return NS_OK; diff --git a/mozilla/intl/strres/src/nsStringBundle.cpp b/mozilla/intl/strres/src/nsStringBundle.cpp index f78b059231f..9224884bdbb 100644 --- a/mozilla/intl/strres/src/nsStringBundle.cpp +++ b/mozilla/intl/strres/src/nsStringBundle.cpp @@ -229,7 +229,7 @@ nsStringBundle::GetInputStream(const char* aURLSpec, nsILocale* aLocale, nsIInpu /* assume the name always ends with this */ - PRInt32 dot = strFile.RFindCharInSet("."); + PRInt32 dot = strFile.RFindChar('.'); count = strFile.Left(fileLeft, (dot>0)?dot:mylen); strFile2 += fileLeft; diff --git a/mozilla/layout/base/nsCSSFrameConstructor.cpp b/mozilla/layout/base/nsCSSFrameConstructor.cpp index 0be0f24f4e7..85bb5cdf098 100644 --- a/mozilla/layout/base/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/base/nsCSSFrameConstructor.cpp @@ -5296,13 +5296,13 @@ nsCSSFrameConstructor::ConstructAlternateImageFrame(nsIPresContext* aPresContex imageElement->GetSrc(altText); if (altText.Length() > 0) { // Trim off the path part of the filename - PRInt32 offset = altText.RFind('/'); + PRInt32 offset = altText.RFindChar('/'); if (offset >= 0) { altText.Cut(0, offset + 1); } // Trim off the extension - offset = altText.RFind('.'); + offset = altText.RFindChar('.'); if (offset >= 0) { altText.Truncate(offset); } diff --git a/mozilla/layout/generic/nsObjectFrame.cpp b/mozilla/layout/generic/nsObjectFrame.cpp index a082ab21c46..d79ae1eb6d4 100644 --- a/mozilla/layout/generic/nsObjectFrame.cpp +++ b/mozilla/layout/generic/nsObjectFrame.cpp @@ -322,7 +322,7 @@ void nsObjectFrame::IsSupportedImage(nsIContent* aContent, PRBool* aImage) nsAutoString ext; PRInt32 iLastCharOffset = data.Length() - 1; - PRInt32 iPointOffset = data.RFind("."); + PRInt32 iPointOffset = data.RFindChar('.'); if(iPointOffset != -1) { diff --git a/mozilla/layout/html/base/src/nsObjectFrame.cpp b/mozilla/layout/html/base/src/nsObjectFrame.cpp index a082ab21c46..d79ae1eb6d4 100644 --- a/mozilla/layout/html/base/src/nsObjectFrame.cpp +++ b/mozilla/layout/html/base/src/nsObjectFrame.cpp @@ -322,7 +322,7 @@ void nsObjectFrame::IsSupportedImage(nsIContent* aContent, PRBool* aImage) nsAutoString ext; PRInt32 iLastCharOffset = data.Length() - 1; - PRInt32 iPointOffset = data.RFind("."); + PRInt32 iPointOffset = data.RFindChar('.'); if(iPointOffset != -1) { diff --git a/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp b/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp index 0be0f24f4e7..85bb5cdf098 100644 --- a/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp @@ -5296,13 +5296,13 @@ nsCSSFrameConstructor::ConstructAlternateImageFrame(nsIPresContext* aPresContex imageElement->GetSrc(altText); if (altText.Length() > 0) { // Trim off the path part of the filename - PRInt32 offset = altText.RFind('/'); + PRInt32 offset = altText.RFindChar('/'); if (offset >= 0) { altText.Cut(0, offset + 1); } // Trim off the extension - offset = altText.RFind('.'); + offset = altText.RFindChar('.'); if (offset >= 0) { altText.Truncate(offset); } diff --git a/mozilla/mailnews/imap/src/nsImapMailFolder.cpp b/mozilla/mailnews/imap/src/nsImapMailFolder.cpp index f3ee2408874..dd8a35730a8 100644 --- a/mozilla/mailnews/imap/src/nsImapMailFolder.cpp +++ b/mozilla/mailnews/imap/src/nsImapMailFolder.cpp @@ -1085,7 +1085,7 @@ NS_IMETHODIMP nsImapMailFolder::PossibleImapMailbox( uri.Append(aSpec->hostName); #if 0 - PRInt32 leafPos = folderName.RFind("/", PR_TRUE); + PRInt32 leafPos = folderName.RFindChar('/'); if (leafPos > 0) { uri.Append('/'); diff --git a/mozilla/mailnews/imap/src/nsImapUtils.cpp b/mozilla/mailnews/imap/src/nsImapUtils.cpp index 3bd3ebf397d..63af0649fb2 100644 --- a/mozilla/mailnews/imap/src/nsImapUtils.cpp +++ b/mozilla/mailnews/imap/src/nsImapUtils.cpp @@ -177,7 +177,7 @@ nsImapURI2Name(const char* rootURI, const char* uriStr, nsString& name) nsAutoString uri = uriStr; if (uri.Find(rootURI) != 0) // if doesn't start with rootURI return NS_ERROR_FAILURE; - PRInt32 pos = uri.RFind("/"); + PRInt32 pos = uri.RFindChar('/'); PRInt32 length = uri.Length(); PRInt32 count = length - (pos + 1); return uri.Right(name, count); diff --git a/mozilla/mailnews/local/src/nsLocalUtils.cpp b/mozilla/mailnews/local/src/nsLocalUtils.cpp index f001d86f7e8..435c1dfe4f0 100644 --- a/mozilla/mailnews/local/src/nsLocalUtils.cpp +++ b/mozilla/mailnews/local/src/nsLocalUtils.cpp @@ -210,14 +210,14 @@ nsLocalURI2Name(const char* rootURI, char* uriStr, nsString& name) nsAutoString uri = uriStr; if (uri.Find(rootURI) != 0) // if doesn't start with rootURI return NS_ERROR_FAILURE; - PRInt32 pos = uri.RFind('/'); + PRInt32 pos = uri.RFindChar('/'); PRInt32 length = uri.Length(); // if the last character is a /, chop it off and search again if (pos == (length-1)) { uri.Truncate(length-1); // chop the last character length--; - pos = uri.RFind('/'); + pos = uri.RFindChar('/'); } PRInt32 count = length - (pos + 1); diff --git a/mozilla/mailnews/news/src/nsNewsUtils.cpp b/mozilla/mailnews/news/src/nsNewsUtils.cpp index ada81bba93f..f52bf9fb0f5 100644 --- a/mozilla/mailnews/news/src/nsNewsUtils.cpp +++ b/mozilla/mailnews/news/src/nsNewsUtils.cpp @@ -215,7 +215,7 @@ nsNewsURI2Name(const char* rootURI, const char* uriStr, nsString& name) nsAutoString uri = uriStr; if (uri.Find(rootURI) != 0) // if doesn't start with rootURI return NS_ERROR_FAILURE; - PRInt32 pos = uri.RFind("/"); + PRInt32 pos = uri.RFindChar('/'); PRInt32 length = uri.Length(); PRInt32 count = length - (pos + 1); return uri.Right(name, count); diff --git a/mozilla/netwerk/protocol/file/src/nsFileChannel.cpp b/mozilla/netwerk/protocol/file/src/nsFileChannel.cpp index 6674269c175..f200d5979bf 100644 --- a/mozilla/netwerk/protocol/file/src/nsFileChannel.cpp +++ b/mozilla/netwerk/protocol/file/src/nsFileChannel.cpp @@ -499,7 +499,7 @@ nsFileChannel::GetContentType(char * *aContentType) // find the file extension nsString2 specStr(cStrSpec); nsString2 extStr; - PRInt32 extLoc = specStr.RFind('.'); + PRInt32 extLoc = specStr.RFindChar('.'); if (-1 != extLoc) { specStr.Right(extStr, specStr.Length() - extLoc - 1); char *ext = extStr.ToNewCString(); diff --git a/mozilla/netwerk/protocol/http/src/nsHTTPChannel.cpp b/mozilla/netwerk/protocol/http/src/nsHTTPChannel.cpp index aabdf3573f5..c4852299556 100644 --- a/mozilla/netwerk/protocol/http/src/nsHTTPChannel.cpp +++ b/mozilla/netwerk/protocol/http/src/nsHTTPChannel.cpp @@ -239,7 +239,7 @@ nsHTTPChannel::GetContentType(char * *aContentType) // find the file extension nsString2 specStr(cStrSpec); nsString2 extStr; - PRInt32 extLoc = specStr.RFind('.'); + PRInt32 extLoc = specStr.RFindChar('.'); if (-1 != extLoc) { specStr.Right(extStr, specStr.Length() - extLoc - 1); char *ext = extStr.ToNewCString(); diff --git a/mozilla/rdf/base/src/nsRDFXMLDataSource.cpp b/mozilla/rdf/base/src/nsRDFXMLDataSource.cpp index 2513395f607..99519e7906e 100644 --- a/mozilla/rdf/base/src/nsRDFXMLDataSource.cpp +++ b/mozilla/rdf/base/src/nsRDFXMLDataSource.cpp @@ -1080,9 +1080,9 @@ RDFXMLDataSourceImpl::MakeQName(nsIRDFResource* resource, } // Okay, so we don't have it in our map. Try to make one up. - PRInt32 i = uri.RFind('#'); // first try a '#' + PRInt32 i = uri.RFindChar('#'); // first try a '#' if (i == -1) { - i = uri.RFind('/'); + i = uri.RFindChar('/'); if (i == -1) { // Okay, just punt and assume there is _no_ namespace on // this thing... diff --git a/mozilla/rdf/brprof/src/nsBrowsingProfile.cpp b/mozilla/rdf/brprof/src/nsBrowsingProfile.cpp index c993817ff52..99784161626 100644 --- a/mozilla/rdf/brprof/src/nsBrowsingProfile.cpp +++ b/mozilla/rdf/brprof/src/nsBrowsingProfile.cpp @@ -393,11 +393,11 @@ nsBrowsingProfile::CountPageVisit(const char* initialURL) nsAutoString urlStr(initialURL); // first chop off any query part of the initialURL - pos = urlStr.RFind("?"); + pos = urlStr.RFindChar('?'); if (pos >= 0) { urlStr.Cut(pos, urlStr.Length()); } - pos = urlStr.RFind("#"); + pos = urlStr.RFindChar('#'); if (pos >= 0) { urlStr.Cut(pos, urlStr.Length()); } @@ -460,7 +460,7 @@ nsBrowsingProfile::CountPageVisit(const char* initialURL) } // _Now_ find the right most forward-slash - pos = urlStr.RFind("/"); + pos = urlStr.RFindChar('/'); if (pos >= 0) { // leave the last '/', as this is the way most opendir diff --git a/mozilla/rdf/content/src/nsXULDocument.cpp b/mozilla/rdf/content/src/nsXULDocument.cpp index 7b3d4066499..a95a8be6e41 100644 --- a/mozilla/rdf/content/src/nsXULDocument.cpp +++ b/mozilla/rdf/content/src/nsXULDocument.cpp @@ -2428,8 +2428,8 @@ XULDocumentImpl::SplitProperty(nsIRDFResource* aProperty, // First try to split the namespace using the rightmost '#' or '/' // character. - if ((i = uri.RFind('#')) < 0) { - if ((i = uri.RFind('/')) < 0) { + if ((i = uri.RFindChar('#')) < 0) { + if ((i = uri.RFindChar('/')) < 0) { *aNameSpaceID = kNameSpaceID_None; *aTag = NS_NewAtom(uri); return NS_OK; diff --git a/mozilla/rdf/datasource/src/nsFTPDataSource.cpp b/mozilla/rdf/datasource/src/nsFTPDataSource.cpp index d46ead0fe3f..c71eaad8775 100644 --- a/mozilla/rdf/datasource/src/nsFTPDataSource.cpp +++ b/mozilla/rdf/datasource/src/nsFTPDataSource.cpp @@ -437,7 +437,7 @@ FTPDataSource::GetName(nsIRDFResource *source, nsIRDFLiteral** aResult) } // get basename - PRInt32 slash = url.RFind('/'); + PRInt32 slash = url.RFindChar('/'); if (slash > 0) { url.Cut(0, slash+1); diff --git a/mozilla/rdf/datasource/src/nsSearchDataSource.cpp b/mozilla/rdf/datasource/src/nsSearchDataSource.cpp index 218e5be462b..1540bcfbdbf 100755 --- a/mozilla/rdf/datasource/src/nsSearchDataSource.cpp +++ b/mozilla/rdf/datasource/src/nsSearchDataSource.cpp @@ -1106,9 +1106,9 @@ SearchDataSource::GetSearchEngineList() #endif { #ifdef XP_MAC - PRInt32 separatorOffset = uri.RFind(":"); + PRInt32 separatorOffset = uri.RFindChar(':'); #else - PRInt32 separatorOffset = uri.RFind("/"); + PRInt32 separatorOffset = uri.RFindChar('/'); #endif if (separatorOffset > 0) { @@ -1241,7 +1241,7 @@ SearchDataSource::ReadFileContents(char *baseFilename, nsString& sourceContents) PRBool wasAliased = PR_FALSE; fileSpec.ResolveAlias(wasAliased); nsAutoString childPath(childURL); - PRInt32 separatorOffset = childPath.RFind(":"); + PRInt32 separatorOffset = childPath.RFindChar(':'); if (separatorOffset > 0) { childPath.Cut(0, separatorOffset+1); diff --git a/mozilla/silentdl/nsSilentDownload.cpp b/mozilla/silentdl/nsSilentDownload.cpp index e5cd13b7b30..a9cd335f72f 100644 --- a/mozilla/silentdl/nsSilentDownload.cpp +++ b/mozilla/silentdl/nsSilentDownload.cpp @@ -148,7 +148,7 @@ CreateOutFileLocation(const nsString& url, const nsString& directory) { nsSpecialSystemDirectory outFileLocation(nsSpecialSystemDirectory::OS_CurrentProcessDirectory); - PRInt32 result = url.RFind('/'); + PRInt32 result = url.RFindChar('/'); if (result != -1) { nsString fileName; diff --git a/mozilla/webshell/tests/viewer/nsWebCrawler.cpp b/mozilla/webshell/tests/viewer/nsWebCrawler.cpp index 3b1a1ff5631..096c2777cd9 100644 --- a/mozilla/webshell/tests/viewer/nsWebCrawler.cpp +++ b/mozilla/webshell/tests/viewer/nsWebCrawler.cpp @@ -414,7 +414,7 @@ nsWebCrawler::GetOutputFile(nsIURI *aURL, nsString& aOutputName) #ifdef NECKO nsCRT::free(file); #endif - PRInt32 fileNameOffset = inputFileFullPath.RFind('/'); + PRInt32 fileNameOffset = inputFileFullPath.RFindChar('/'); if (-1==fileNameOffset) { inputFileName = new char[strlen(kDefaultOutputFileName) + 1]; diff --git a/mozilla/xpinstall/src/nsInstall.cpp b/mozilla/xpinstall/src/nsInstall.cpp index 079c1032e11..57381194ed5 100644 --- a/mozilla/xpinstall/src/nsInstall.cpp +++ b/mozilla/xpinstall/src/nsInstall.cpp @@ -71,11 +71,11 @@ #endif #ifdef XP_PC -#define FILESEP "\\" +#define FILESEP '\\' #elif defined(XP_MAC) -#define FILESEP ":" +#define FILESEP ':' #else -#define FILESEP "/" +#define FILESEP '/' #endif static NS_DEFINE_IID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID); @@ -791,7 +791,7 @@ nsInstall::GetComponentFolder(const nsString& aComponentName, const nsString& aS int i; nsString dirStr(dir); - if ( (i = dirStr.RFind(FILESEP)) > 0 ) + if ( (i = dirStr.RFindChar(FILESEP)) > 0 ) { // i is the index in the string, not the total number of // characters in the string. ToCString() requires the @@ -1906,7 +1906,7 @@ nsInstall::ExtractFileFromJar(const nsString& aJarfile, nsFileSpec* aSuggestedNa nsString tempFileName = "xpinstall"; // Get the extension of the file in the JAR - result = aJarfile.RFind("."); + result = aJarfile.RFindChar('.'); if (result != -1) { // We found the extension; add it to the tempFileName string diff --git a/mozilla/xpinstall/src/nsInstallPatch.cpp b/mozilla/xpinstall/src/nsInstallPatch.cpp index 5bc77bdffe3..8f4be5886d9 100644 --- a/mozilla/xpinstall/src/nsInstallPatch.cpp +++ b/mozilla/xpinstall/src/nsInstallPatch.cpp @@ -420,7 +420,7 @@ nsInstallPatch::NativePatch(const nsFileSpec &sourceFile, const nsFileSpec &patc nsString newFileName = sourceFile.GetLeafName(); PRInt32 index; - if ((index = newFileName.RFind(".")) > 0) + if ((index = newFileName.RFindChar('.')) > 0) { nsString extention; nsString fileName; diff --git a/mozilla/xpinstall/src/nsInstallTrigger.cpp b/mozilla/xpinstall/src/nsInstallTrigger.cpp index 0684a01e728..f3951b494da 100644 --- a/mozilla/xpinstall/src/nsInstallTrigger.cpp +++ b/mozilla/xpinstall/src/nsInstallTrigger.cpp @@ -285,14 +285,14 @@ nsInstallTrigger::CreateTempFileFromURL(const nsString& aURL, nsString& tempFile { nsSpecialSystemDirectory tempFile(nsSpecialSystemDirectory::OS_TemporaryDirectory); - PRInt32 result = aURL.RFind("/"); + PRInt32 result = aURL.RFindChar('/'); if (result != -1) { nsString jarName; aURL.Right(jarName, (aURL.Length() - result) ); - PRInt32 argOffset = jarName.RFind("?"); + PRInt32 argOffset = jarName.RFindChar('?'); if (argOffset != -1) { diff --git a/mozilla/xpinstall/src/nsXPInstallManager.cpp b/mozilla/xpinstall/src/nsXPInstallManager.cpp index 67600f34386..00fb7525552 100644 --- a/mozilla/xpinstall/src/nsXPInstallManager.cpp +++ b/mozilla/xpinstall/src/nsXPInstallManager.cpp @@ -187,7 +187,7 @@ nsresult nsXPInstallManager::DownloadNext() // --- figure out a temp file name nsSpecialSystemDirectory temp(nsSpecialSystemDirectory::OS_TemporaryDirectory); - PRInt32 pos = mItem->mURL.RFind('/'); + PRInt32 pos = mItem->mURL.RFindChar('/'); if ( pos != -1 ) { nsString jarleaf;