aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMax Horn2006-05-03 20:43:26 +0000
committerMax Horn2006-05-03 20:43:26 +0000
commitd016c353c5f2f87278e244ec6418c87d681925b1 (patch)
tree33040b385072a3611ce4bc76079ee68128a76a53 /engines
parent1902673ece88d54ae5ae6b51ef63da6b07477bba (diff)
downloadscummvm-rg350-d016c353c5f2f87278e244ec6418c87d681925b1.tar.gz
scummvm-rg350-d016c353c5f2f87278e244ec6418c87d681925b1.tar.bz2
scummvm-rg350-d016c353c5f2f87278e244ec6418c87d681925b1.zip
Changed FilesystemNode::listDir to return a bool indicating its success (or failure)
svn-id: r22315
Diffstat (limited to 'engines')
-rw-r--r--engines/scumm/plugin.cpp8
-rw-r--r--engines/sword1/sword1.cpp7
2 files changed, 11 insertions, 4 deletions
diff --git a/engines/scumm/plugin.cpp b/engines/scumm/plugin.cpp
index 5d37a8609c..cba5b77005 100644
--- a/engines/scumm/plugin.cpp
+++ b/engines/scumm/plugin.cpp
@@ -1318,14 +1318,18 @@ PluginError Engine_SCUMM_create(OSystem *syst, Engine **engine) {
}
+ FSList fslist;
FilesystemNode dir;
if (ConfMan.hasKey("path") )
dir = FilesystemNode(ConfMan.get("path"));
- FSList fslist = dir.listDir(FilesystemNode::kListFilesOnly);
- Common::List<DetectorResult> results;
+ if (!dir.listDir(fslist, FilesystemNode::kListFilesOnly)) {
+ warning("ScummEngine: invalid game path '%s'", dir.path().c_str());
+ return kInvalidPathError;
+ }
// Invoke the detector, but fixed to the specified gameid.
+ Common::List<DetectorResult> results;
detectGames(fslist, results, gameid);
// Unable to locate game data
diff --git a/engines/sword1/sword1.cpp b/engines/sword1/sword1.cpp
index b31df25db5..e57cadcff3 100644
--- a/engines/sword1/sword1.cpp
+++ b/engines/sword1/sword1.cpp
@@ -90,8 +90,11 @@ void Sword1CheckDirectory(const FSList &fslist, bool *filesFound) {
filesFound[cnt] = true;
} else {
for (int cnt = 0; cnt < ARRAYSIZE(g_dirNames); cnt++)
- if (scumm_stricmp(file->displayName().c_str(), g_dirNames[cnt]) == 0)
- Sword1CheckDirectory(file->listDir(FilesystemNode::kListFilesOnly), filesFound);
+ if (scumm_stricmp(file->displayName().c_str(), g_dirNames[cnt]) == 0) {
+ FSList fslist2;
+ if (file->listDir(fslist2, FilesystemNode::kListFilesOnly))
+ Sword1CheckDirectory(fslist2, filesFound);
+ }
}
}
}