More goto removals.

Note: unsure if the path must be collapsed each time.
This commit is contained in:
Jason Felds
2013-01-24 22:38:24 -05:00
parent f3fdfd7b8e
commit fbc605302d
+12 -4
View File
@@ -34,12 +34,18 @@ void ActorUtil::Register( const RString& sClassName, CreateActorFn pfn )
bool ActorUtil::ResolvePath( RString &sPath, const RString &sName )
{
retry:
bool done = false;
// comply with VS C4701.
RageFileManager::FileType ft = RageFileManager::TYPE_NONE;
while (!done)
{
// Does this have to be collapsed every time?
CollapsePath( sPath );
// If we know this is an exact match, don't bother with the GetDirListing,
// so "foo" doesn't partial match "foobar" if "foo" exists.
RageFileManager::FileType ft = FILEMAN->GetFileType( sPath );
ft = FILEMAN->GetFileType( sPath );
if( ft != RageFileManager::TYPE_FILE && ft != RageFileManager::TYPE_DIR )
{
vector<RString> asPaths;
@@ -55,7 +61,7 @@ retry:
break;
case Dialog::retry:
FILEMAN->FlushDirCache();
goto retry;
continue;
case Dialog::ignore:
return false;
default:
@@ -76,7 +82,7 @@ retry:
break;
case Dialog::retry:
FILEMAN->FlushDirCache();
goto retry;
continue;
case Dialog::ignore:
asPaths.erase( asPaths.begin()+1, asPaths.end() );
break;
@@ -87,6 +93,8 @@ retry:
sPath = asPaths[0];
}
done = true;
}
if( ft == RageFileManager::TYPE_DIR )
{