diff options
author | Cameron Cawley | 2019-07-01 22:42:41 +0100 |
---|---|---|
committer | Filippos Karapetis | 2019-08-11 22:15:54 +0300 |
commit | 04c57babbc06dfba33a5597a83e80c27c1ba6be9 (patch) | |
tree | 30c6ccc134a4727b4dd9c19c8cc7b2b27666bafb /backends/saves | |
parent | 43b4528552dc7b2a04abd31f88e1e83a726fc98b (diff) | |
download | scummvm-rg350-04c57babbc06dfba33a5597a83e80c27c1ba6be9.tar.gz scummvm-rg350-04c57babbc06dfba33a5597a83e80c27c1ba6be9.tar.bz2 scummvm-rg350-04c57babbc06dfba33a5597a83e80c27c1ba6be9.zip |
BACKENDS: Create the default save directory if it doesn't exist
Diffstat (limited to 'backends/saves')
-rw-r--r-- | backends/saves/default/default-saves.cpp | 4 |
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"); } |