From b3338410858944fc3efd06314ddd4d37615f699c Mon Sep 17 00:00:00 2001 From: Charles Lohr Date: Fri, 26 Nov 2004 16:17:01 +0000 Subject: [PATCH] OOps, maybe the work around will work this time around. --- stepmania/src/ScreenPackages.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/stepmania/src/ScreenPackages.cpp b/stepmania/src/ScreenPackages.cpp index 6a1e78f0ca..b8ad912fdf 100644 --- a/stepmania/src/ScreenPackages.cpp +++ b/stepmania/src/ScreenPackages.cpp @@ -98,9 +98,17 @@ ScreenPackages::ScreenPackages( CString sClassName ) : ScreenWithMenuElements( s UpdateProgress(); - //Workaround: For some reason, the first download always + //Workaround: For some reason, the first download sometimes //corrupts; by opening and closing the rage file, this //problem does not occour. Go figure? + + //XXX: This is a really dirty work around! + //Why does RageFile do this? + + //It's always some strange number of bytes at the end of the + //file when it corrupts. + m_fOutputFile.Open( "Packages/dummy.txt", 0x02 ); + m_fOutputFile.Flush( ); m_fOutputFile.Close(); } @@ -631,6 +639,7 @@ void ScreenPackages::HTTPUpdate() else if ( m_bIsPackage && ( m_iResponceCode < 300 ) ) { + m_fOutputFile.Flush( ); m_fOutputFile.Close( ); FlushDirCache( ); RefreshPackages( );