From bf8ac3e2a88e029d16b8bd91595019ce8c1ea797 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 27 Feb 2004 06:20:59 +0000 Subject: [PATCH] fix paths not resolving correctly if they begin with ./ (CDTitles) --- stepmania/src/RageFileManager.cpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/stepmania/src/RageFileManager.cpp b/stepmania/src/RageFileManager.cpp index 72f6f7ead9..f8221606e8 100644 --- a/stepmania/src/RageFileManager.cpp +++ b/stepmania/src/RageFileManager.cpp @@ -151,16 +151,22 @@ RageFileManager::~RageFileManager() CString LoadedDriver::GetPath( CString path ) { - path.Replace( "\\", "/" ); - - /* If the path begins with @, default mount points don't count. */ - const bool Dedicated = ( path.size() && path[0] == '@' ); - if( MountPoint.size() == 0 ) - return Dedicated? "":path; - /* Map all slashes to forward slash. */ - path.Replace( "\\", "/" ); + FixSlashesInPlace( path ); + /* Collapse the path, removing any leading dots. (FilenameDB::ResolvePath requires + * this.) */ + CollapsePath( path, true ); + + /* Default mountpoints: */ + if( MountPoint.size() == 0 ) + { + /* If the path begins with @, default mount points don't count. */ + if( path.size() && path[0] == '@' ) + return ""; + return path; + } + if( path.Left( MountPoint.size() ).CompareNoCase( MountPoint ) ) return ""; /* no match */