aboutsummaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
authorvandalo2016-03-15 23:09:42 +0100
committerFerran coma rosell2016-04-16 17:59:20 +0200
commita406ce6d557a79a32b3d8b7f6c60971806cd06a5 (patch)
tree08dd30aeb215db41e2a0e9a3c0cca433e7c0d03e /base
parentbd81da1a6a7604805c927073f086767c5baf2bac (diff)
downloadscummvm-rg350-a406ce6d557a79a32b3d8b7f6c60971806cd06a5.tar.gz
scummvm-rg350-a406ce6d557a79a32b3d8b7f6c60971806cd06a5.tar.bz2
scummvm-rg350-a406ce6d557a79a32b3d8b7f6c60971806cd06a5.zip
COMMON: Fix wrong error message
The error message was not correct. When you add a game data dir to launcher and after do this rename game data dir the error was wrong. It said that the "path wasn't a directory", the expected error message was "Path does not exists" because we had changed. How to solve this: We split in two the validation of the path, first we check if it's a existing path and then if the path is a directory. if (!dir.exists()) err = Common::kPathDoesNotExist; else if (!dir.isDirectory()) err = Common::kPathNotDirectory; Solve Bug: 6765 Wrong error code if directory missing
Diffstat (limited to 'base')
-rw-r--r--base/main.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/base/main.cpp b/base/main.cpp
index ff441df49c..96e2765e27 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -148,8 +148,11 @@ static Common::Error runGame(const EnginePlugin *plugin, OSystem &system, const
#endif
// Verify that the game path refers to an actual directory
- if (!(dir.exists() && dir.isDirectory()))
+ if (!dir.exists()) {
+ err = Common::kPathDoesNotExist;
+ } else if (!dir.isDirectory()) {
err = Common::kPathNotDirectory;
+ }
// Create the game engine
if (err.getCode() == Common::kNoError) {