From 63387dc3520037a57dc7c95449661a5d3a6dafb1 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Wed, 7 Oct 2015 21:07:09 -0400 Subject: [PATCH] Backport "for each" loop to restore AppData cache. --- src/RageFileManager.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/RageFileManager.cpp b/src/RageFileManager.cpp index 9a58f02fdd..d5ceab40c1 100644 --- a/src/RageFileManager.cpp +++ b/src/RageFileManager.cpp @@ -410,11 +410,12 @@ void RageFileManager::GetDirListing( const RString &sPath_, vector &Add /* If returning the path, prepend the mountpoint name to the files this driver returned. */ if( bReturnPathToo && pLoadedDriver->m_sMountPoint.size() > 0 ) { + RString const &mountPoint = pLoadedDriver->m_sMountPoint; + /* Skip the trailing slash on the mountpoint; there's already a slash there. */ + RString const &trimPoint = mountPoint.substr(0, mountPoint.size() - 1); for( unsigned j = OldStart; j < AddTo.size(); ++j ) { - /* Skip the trailing slash on the mountpoint; there's already a slash there. */ - RString &lPath = AddTo[j]; - lPath.insert( 0, pLoadedDriver->m_sMountPoint, pLoadedDriver->m_sMountPoint.size()-1 ); + AddTo[j] = trimPoint + AddTo[j]; } } }