aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCameron Cawley2019-07-01 22:42:41 +0100
committerFilippos Karapetis2019-08-11 22:15:54 +0300
commit04c57babbc06dfba33a5597a83e80c27c1ba6be9 (patch)
tree30c6ccc134a4727b4dd9c19c8cc7b2b27666bafb
parent43b4528552dc7b2a04abd31f88e1e83a726fc98b (diff)
downloadscummvm-rg350-04c57babbc06dfba33a5597a83e80c27c1ba6be9.tar.gz
scummvm-rg350-04c57babbc06dfba33a5597a83e80c27c1ba6be9.tar.bz2
scummvm-rg350-04c57babbc06dfba33a5597a83e80c27c1ba6be9.zip
BACKENDS: Create the default save directory if it doesn't exist
-rw-r--r--backends/saves/default/default-saves.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/backends/saves/default/default-saves.cpp b/backends/saves/default/default-saves.cpp
index e9a4165ddb..17e888175c 100644
--- a/backends/saves/default/default-saves.cpp
+++ b/backends/saves/default/default-saves.cpp
@@ -63,7 +63,9 @@ DefaultSaveFileManager::DefaultSaveFileManager(const Common::String &defaultSave
void DefaultSaveFileManager::checkPath(const Common::FSNode &dir) {
clearError();
if (!dir.exists()) {
- setError(Common::kPathDoesNotExist, "The savepath '"+dir.getPath()+"' does not exist");
+ if (!dir.createDirectory()) {
+ setError(Common::kPathDoesNotExist, "Failed to create directory '"+dir.getPath()+"'");
+ }
} else if (!dir.isDirectory()) {
setError(Common::kPathNotDirectory, "The savepath '"+dir.getPath()+"' is not a directory");
}