From 451bb4c39607d72f661a51fb89f9e354b4de3d94 Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Thu, 29 Dec 2005 02:01:10 +0000 Subject: [PATCH] SetExtension does not modify sName. Also, after calling SetExtension( sName, "" ), the period is removed so if the file name is foo.bar.baz, then calling SetExtension with "" followed by "bur" you end up with foo.bur. Instead, just append "." + sExt. --- stepmania/src/RageUtil.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stepmania/src/RageUtil.cpp b/stepmania/src/RageUtil.cpp index 010fd6fdd6..0251d58495 100644 --- a/stepmania/src/RageUtil.cpp +++ b/stepmania/src/RageUtil.cpp @@ -736,10 +736,10 @@ void MakeValidFilename( CString &sName ) if( Basename(sName).size() > 128 ) { /* The filename is too long. Truncate it, but leave the extension alone. */ - RString sExt = GetExtension( sName ); - SetExtension( sName, "" ); + const RString& sExt = GetExtension( sName ); + sName = SetExtension( sName, "" ); sName.erase( 128 ); - SetExtension( sName, sExt ); + sName = sName + "." + sExt; } }