From 95e35750944f1a1005029ee6c99b8bdc304c7b90 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 4 Sep 2003 19:29:42 +0000 Subject: [PATCH] Fix "Capitalize DWI, no SM": m_sSongFileName was not set correctly if a DWI extension wasn't lower-case. --- stepmania/src/Song.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index cb098fed28..ed83e302bd 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -437,9 +437,7 @@ bool Song::LoadFromSongDir( CString sDir ) else { GetDirListing( m_sSongDir+"*.dwi", asFileNames ); if( !asFileNames.empty() ) { - m_sSongFileName += asFileNames[0]; - /* XXX: This would mess up "vote.for.dwight.d.eisenhower.dwi". */ - m_sSongFileName.Replace( ".dwi", ".sm" ); + m_sSongFileName += SetExtension( asFileNames[0], "sm" ); } else { m_sSongFileName += sDirectoryParts[sDirectoryParts.size()-2]; // last item m_sSongFileName += ".sm"; @@ -1052,8 +1050,7 @@ void Song::SaveToDWIFile() { LOG->Trace( "Song::SaveToSongFileAndDWI()" ); - CString sPath = GetSongFilePath(); - sPath.Replace( ".sm", ".dwi" ); + CString sPath = SetExtension( GetSongFilePath(), "dwi" ); NotesWriterDWI wr; wr.Write(sPath, *this);