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.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user