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
Родитель 71bd25563e
Коммит 4cecc7242a
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -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 );