Bug 116957: Put Adopt on ns{C}String, and use it in nsStandardURL. r=dbaron, rs=scc
git-svn-id: svn://10.0.0.236/trunk@111092 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -864,7 +864,14 @@ void nsCString::InsertWithConversion(PRUnichar aChar,PRUint32 anOffset){
|
||||
}
|
||||
|
||||
|
||||
|
||||
void nsCString::Adopt(char* aPtr, PRInt32 aLength) {
|
||||
nsStr::Destroy(*this);
|
||||
if (aLength == -1)
|
||||
aLength = nsCharTraits<char>::length(aPtr);
|
||||
// We don't know the capacity, so we'll just have to assume
|
||||
// capacity = length.
|
||||
nsStr::Initialize(*this, aPtr, aLength, aLength, eOneByte, PR_TRUE);
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
Searching methods...
|
||||
|
||||
Reference in New Issue
Block a user