if (!parentRes) { return(NS_ERROR_UNEXPECTED);
if (!parentRes) { NS_ERROR("Could not obtain parent resource"); return(NS_ERROR_UNEXPECTED);
nsHTTPIndexParser::ProcessData(nsISupports *context){    nsXPIDLCString  encodingStr;	if (mHTTPIndex)	{	    mHTTPIndex->GetEncoding(getter_Copies(encodingStr));	}    nsCOMPtr<nsIRDFResource>	parentRes = do_QueryInterface(context);    if (!parentRes)    {        return(NS_ERROR_UNEXPECTED);    }  // First, we'll iterate through the values and remember each (using  // an array of autostrings allocated on the stack, if possible). We  // have to do this, because we don't know up-front the filename for  // which this 201 refers.#define MAX_AUTO_VALUES 8  nsString autovalues[MAX_AUTO_VALUES];  nsString* values = autovalues;  if (mFormat.Count() > MAX_AUTO_VALUES) {    // Yeah, we really -do- want to create nsAutoStrings in the heap    // here, because most of the fields will be l.t. 32 characters:    // this avoids an extra allocation for the nsString's buffer.    values = new nsString[mFormat.Count()];    if (! values)    {      return NS_ERROR_OUT_OF_MEMORY;    }  }  PRInt32     numItems = 0;    while(PR_TRUE) {    ++numItems;        PRInt32		eol = mBuf.FindCharInSet("\n\r", mLineStart);    if (eol < 0)	break;    mBuf.SetCharAt(PRUnichar('\0'), eol);        const char  *line = &mBuf.mStr[mLineStart];        PRInt32 lineLen = eol - mLineStart;    mLineStart = eol + 1;        if (lineLen >= 4) {      nsresult	rv;      const char	*buf = line;            if (buf[0] == '1') {        if (buf[1] == '0') {          if (buf[2] == '0' && buf[3] == ':') {            // 100. Human-readable comment line. Ignore          } else if (buf[2] == '1' && buf[3] == ':') {            // 101. Human-readable information line.              mComment.AppendWithConversion(buf + 4);          } else if (buf[2] == '2' && buf[3] == ':') {            // 102. Human-readable information line, HTML.            mComment.AppendWithConversion(buf + 4);          }        }      } else if (buf[0] == '2') {        if (buf[1] == '0') {          if (buf[2] == '0' && buf[3] == ':') {            // 200. Define field names            rv = ParseFormat(buf + 4);            if (NS_FAILED(rv)) {              return rv;            }          } else if (buf[2] == '1' && buf[3] == ':') {            // 201. Field data            rv = ParseData(values, encodingStr, ((char *)buf) + 4, parentRes);            if (NS_FAILED(rv)) {              return rv;            }          }        }      } else if (buf[0] == '3') {        if (buf[1] == '0') {          if (buf[2] == '0' && buf[3] == ':') {            // 300. Self-referring URL          }        }      }    }  }    // If we needed to spill values onto the heap, make sure we clean up  // here.  if (values != autovalues)    delete[] values;    return(NS_OK);}