bug 209098: TestParser crashes inside nsLoggingSink. patch by mats.palmgren@bredband.net r=harishd sr=peterv
git-svn-id: svn://10.0.0.236/trunk@166794 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -560,7 +560,7 @@ nsLoggingSink::OpenNode(const char* aKind, const nsIParserNode& aNode) {
|
||||
PR_fprintf(mOutput, "\"%s\"", NS_ConvertUCS2toUTF8(tag).get());
|
||||
}
|
||||
else {
|
||||
char* text;
|
||||
char* text = nsnull;
|
||||
GetNewCString(aNode.GetText(), &text);
|
||||
if(text) {
|
||||
PR_fprintf(mOutput, "\"%s\"", text);
|
||||
@@ -701,7 +701,7 @@ nsLoggingSink::LeafNode(const nsIParserNode& aNode)
|
||||
else {
|
||||
PRInt32 pos;
|
||||
nsAutoString tmp;
|
||||
char* str;
|
||||
char* str = nsnull;
|
||||
switch (nodeType) {
|
||||
case eHTMLTag_whitespace:
|
||||
case eHTMLTag_text:
|
||||
@@ -777,9 +777,7 @@ nsLoggingSink::GetNewCString(const nsAString& aValue, char** aResult)
|
||||
nsAutoString temp;
|
||||
result=QuoteText(aValue,temp);
|
||||
if(NS_SUCCEEDED(result)) {
|
||||
if(!temp.IsEmpty()) {
|
||||
*aResult = ToNewCString(temp);
|
||||
}
|
||||
*aResult = temp.IsEmpty() ? nsnull : ToNewCString(temp);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user