From f243a4d52fd827ef9563afeb9589a6787eec8211 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 18 Dec 2003 08:48:36 +0000 Subject: [PATCH] fix AdditionalSongFolders --- stepmania/src/RageUtil_FileDB.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/stepmania/src/RageUtil_FileDB.cpp b/stepmania/src/RageUtil_FileDB.cpp index 8427607f9d..c908b07931 100644 --- a/stepmania/src/RageUtil_FileDB.cpp +++ b/stepmania/src/RageUtil_FileDB.cpp @@ -386,15 +386,17 @@ void FilenameDB::GetDirListing( CString sPath, CStringArray &AddTo, bool bOnlyDi /* Strip off the last path element and use it as a mask. */ unsigned pos = sPath.find_last_of( '/' ); CString fn; - if(pos != sPath.npos) + if( pos == sPath.npos ) { + fn = sPath; + sPath = ""; + } else { fn = sPath.substr(pos+1); sPath = sPath.substr(0, pos+1); } - /* If there was only one path element, or if the last element was empty, - * use "*". */ - if(fn.size() == 0) + /* If the last element was empty, use "*". */ + if( fn.size() == 0 ) fn = "*"; unsigned start = AddTo.size();