aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Tkachev2016-08-30 21:08:02 +0600
committerAlexander Tkachev2016-08-30 21:08:02 +0600
commitf8fe150130c04478818461a9241dad2995ebefb9 (patch)
tree4e3e358e0f987de3d2db48fafa552be563457cb9
parent579cb59af52b4b891306ca8be430f772ecfb0364 (diff)
downloadscummvm-rg350-f8fe150130c04478818461a9241dad2995ebefb9.tar.gz
scummvm-rg350-f8fe150130c04478818461a9241dad2995ebefb9.tar.bz2
scummvm-rg350-f8fe150130c04478818461a9241dad2995ebefb9.zip
CLOUD: Fix Webserver's usage of DefaultSaveFileManager
concatWithSavesPath() is only defined when curl is used, but was used in Webserver even when curl is unavailable.
-rw-r--r--backends/networking/sdl_net/handlers/filesbasehandler.cpp4
-rw-r--r--backends/networking/sdl_net/handlerutils.cpp4
2 files changed, 8 insertions, 0 deletions
diff --git a/backends/networking/sdl_net/handlers/filesbasehandler.cpp b/backends/networking/sdl_net/handlers/filesbasehandler.cpp
index 135e0fb100..a585af9b5a 100644
--- a/backends/networking/sdl_net/handlers/filesbasehandler.cpp
+++ b/backends/networking/sdl_net/handlers/filesbasehandler.cpp
@@ -69,8 +69,12 @@ bool FilesBaseHandler::transformPath(Common::String &path, Common::String &prefi
prefixToAdd = "/saves/";
// determine savepath (prefix to remove)
+#ifdef USE_LIBCURL
DefaultSaveFileManager *manager = dynamic_cast<DefaultSaveFileManager *>(g_system->getSavefileManager());
prefixToRemove = (manager ? manager->concatWithSavesPath("") : ConfMan.get("savepath"));
+#else
+ prefixToRemove = ConfMan.get("savepath");
+#endif
if (prefixToRemove.size() && prefixToRemove.lastChar() != '/' && prefixToRemove.lastChar() != '\\')
prefixToRemove += '/';
diff --git a/backends/networking/sdl_net/handlerutils.cpp b/backends/networking/sdl_net/handlerutils.cpp
index dc21ab5ce1..fba00aef59 100644
--- a/backends/networking/sdl_net/handlerutils.cpp
+++ b/backends/networking/sdl_net/handlerutils.cpp
@@ -159,8 +159,12 @@ bool HandlerUtils::hasPermittedPrefix(const Common::String &path) {
}
// prefix for /saves/
+#ifdef USE_LIBCURL
DefaultSaveFileManager *manager = dynamic_cast<DefaultSaveFileManager *>(g_system->getSavefileManager());
prefix = (manager ? manager->concatWithSavesPath("") : ConfMan.get("savepath"));
+#else
+ prefix = ConfMan.get("savepath");
+#endif
return (normalized.hasPrefix(normalizePath(prefix)));
}