Bug 513832: Initialize 'state' before passing it to ParseFTPList(),

and pass the same 'state' to subsequent ParseFTPList() calls.
sr=bzbarsky.
This commit is contained in:
Wan-Teh Chang 2009-09-04 11:27:07 -07:00
parent 969ed37003
commit dbf75d51ad

View File

@ -283,6 +283,9 @@ nsFTPDirListingConv::DigestBufferLines(char *aBuffer, nsCString &aString) {
char *eol;
PRBool cr = PR_FALSE;
list_state state;
state.magic = 0;
// while we have new lines, parse 'em into application/http-index-format.
while ( line && (eol = PL_strchr(line, nsCRT::LF)) ) {
// yank any carriage returns too.
@ -295,7 +298,6 @@ nsFTPDirListingConv::DigestBufferLines(char *aBuffer, nsCString &aString) {
cr = PR_FALSE;
}
list_state state;
list_result result;
int type = ParseFTPList(line, &state, &result );