From ac3613a8112e2a9949f52c7414a9821ab9da621b Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 18 Feb 2004 05:32:02 +0000 Subject: [PATCH] fix incorrect warnings don't warn on "file not found" --- stepmania/src/Profile.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/stepmania/src/Profile.cpp b/stepmania/src/Profile.cpp index c3c633e30e..2b22eca614 100644 --- a/stepmania/src/Profile.cpp +++ b/stepmania/src/Profile.cpp @@ -453,13 +453,15 @@ void Profile::LoadSongScoresFromDir( CString sDir ) CHECKPOINT; CString fn = sDir + SONG_SCORES_XML; + if( !IsAFile(fn) ) + return; CRYPT_VERIFY_FILE; XNode xml; if( !xml.LoadFromFile( fn ) ) { - LOG->Warn( "Couldn't open file \"%s\" for writing.", fn.c_str() ); + LOG->Warn( "Couldn't open file \"%s\" for reading.", fn.c_str() ); return; } @@ -845,13 +847,15 @@ void Profile::LoadCourseScoresFromDir( CString sDir ) CHECKPOINT; CString fn = sDir + COURSE_SCORES_XML; + if( !IsAFile(fn) ) + return; CRYPT_VERIFY_FILE; XNode xml; if( !xml.LoadFromFile( fn ) ) { - LOG->Warn( "Couldn't open file \"%s\" for writing.", fn.c_str() ); + LOG->Warn( "Couldn't open file \"%s\" for reading.", fn.c_str() ); return; } @@ -934,13 +938,15 @@ void Profile::LoadCategoryScoresFromDir( CString sDir ) CHECKPOINT; CString fn = sDir + CATEGORY_SCORES_XML; + if( !IsAFile(fn) ) + return; CRYPT_VERIFY_FILE; XNode xml; if( !xml.LoadFromFile( fn ) ) { - LOG->Warn( "Couldn't open file \"%s\" for writing.", fn.c_str() ); + LOG->Warn( "Couldn't open file \"%s\" for reading.", fn.c_str() ); return; } @@ -1027,13 +1033,15 @@ void Profile::LoadScreenshotDataFromDir( CString sDir ) CHECKPOINT; CString fn = sDir + SCREENSHOT_DATA_XML; + if( !IsAFile(fn) ) + return; CRYPT_VERIFY_FILE; XNode xml; if( !xml.LoadFromFile( fn ) ) { - LOG->Warn( "Couldn't open file \"%s\" for writing.", fn.c_str() ); + LOG->Warn( "Couldn't open file \"%s\" for reading.", fn.c_str() ); return; }