line.Truncate();
BookmarkParser::Parse(nsIRDFResource* aContainer, nsIRDFResource *nodeType){	// tokenize the input stream.	// XXX this needs to handle quotes, etc. it'd be nice to use the real parser for this...    nsresult rv = NS_OK;    nsAutoString line;	while (NS_SUCCEEDED(rv) && !mStream->eof() && !mStream->failed()) {        char c = mStream->get();        line.Append(c);        if (line.Last() != '\n' && line.Last() != '\r' && !mStream->eof())            continue; // keep building the string        PRInt32 offset;        if ((offset = line.Find(kHREFEquals)) >= 0) {            rv = ParseBookmark(line, aContainer, nodeType);        }        else if ((offset = line.Find(kOpenHeading)) >= 0 &&                 nsString::IsDigit(line.CharAt(offset + 2))) {            // XXX Ignore <H1> so that bookmarks root _is_ <H1>            if (line.CharAt(offset + 2) != PRUnichar('1'))                rv = ParseBookmarkHeader(line, aContainer, nodeType);        }        else if ((offset = line.Find(kSeparator)) >= 0) {            rv = ParseBookmarkSeparator(line, aContainer);        }        else if ((offset = line.Find(kCloseUL)) >= 0 ||                 (offset = line.Find(kCloseMenu)) >= 0 ||                 (offset = line.Find(kCloseDL)) >= 0) {            return ParseHeaderEnd(line);        }        else if ((offset = line.Find(kOpenUL)) >= 0 ||                 (offset = line.Find(kOpenMenu)) >= 0 ||                 (offset = line.Find(kOpenDL)) >= 0) {            rv = ParseHeaderBegin(line, aContainer);        }        else {            // XXX Discard the line. We should be treating this as the            // description.        }        line.Truncate();    }    return rv;}