fix for #29894, newsrc file corruption. need to truncate the newsrc when

we open it.  otherwise, if we go to write it out and it has gotten smaller,
we will leave garbage at the end of the file.  big thanks to Ken Dowling (kdowling@concentric.net) reporting this bug. a=jar
This commit is contained in:
sspitzer%netscape.com 2000-03-02 05:19:18 +00:00
parent 565d93720f
commit fc15ea4ee1

View File

@ -194,7 +194,7 @@ nsNntpIncomingServer::WriteNewsrcFile()
rv = newsrcFile->GetFileSpec(&newsrcFileSpec);
if (NS_FAILED(rv)) return rv;
nsIOFileStream newsrcStream(newsrcFileSpec /*, PR_CREATE_FILE */ );
nsIOFileStream newsrcStream(newsrcFileSpec, (PR_RDWR | PR_CREATE_FILE | PR_TRUNCATE));
nsCOMPtr<nsIEnumerator> subFolders;
nsCOMPtr<nsIFolder> rootFolder;