aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backends/saves/default/default-saves.cpp7
-rw-r--r--common/file.cpp6
-rw-r--r--common/file.h4
3 files changed, 10 insertions, 7 deletions
diff --git a/backends/saves/default/default-saves.cpp b/backends/saves/default/default-saves.cpp
index 702b404434..c32edd0f7a 100644
--- a/backends/saves/default/default-saves.cpp
+++ b/backends/saves/default/default-saves.cpp
@@ -229,9 +229,12 @@ Common::OutSaveFile *DefaultSaveFileManager::openForSaving(const char *filename)
}
bool DefaultSaveFileManager::removeSavefile(const char *filename) {
+ char buf[256];
+ join_paths(filename, getSavePath(), buf, sizeof(buf));
+
Common::File file;
- FilesystemNode savePath(filename);
- return file.remove(savePath);
+ FilesystemNode savePath((const char *)buf);
+ return file.removeFile(savePath);
}
#endif // !defined(DISABLE_DEFAULT_SAVEFILEMANAGER)
diff --git a/common/file.cpp b/common/file.cpp
index cdf8d5e13e..f7e4177e56 100644
--- a/common/file.cpp
+++ b/common/file.cpp
@@ -409,7 +409,7 @@ bool File::open(const FilesystemNode &node, AccessMode mode) {
return true;
}
-bool File::remove(const String &filename){
+bool File::removeFile(const String &filename){
if (remove(filename.c_str()) != 0) {
if (errno == EACCES) {
//TODO: read-only file
@@ -424,8 +424,8 @@ bool File::remove(const String &filename){
}
}
-bool File::remove(const FilesystemNode &node){
- if (remove(node.getPath()) != 0) {
+bool File::removeFile(const FilesystemNode &node){
+ if (remove(node.getPath().c_str()) != 0) {
if (errno == EACCES) {
//TODO: read-only file
}
diff --git a/common/file.h b/common/file.h
index 4bec6605e7..d966d95f2d 100644
--- a/common/file.h
+++ b/common/file.h
@@ -85,8 +85,8 @@ public:
virtual void close();
- virtual bool remove(const String &filename);
- virtual bool remove(const FilesystemNode &node);
+ virtual bool removeFile(const String &filename);
+ virtual bool removeFile(const FilesystemNode &node);
/**
* Checks if the object opened a file successfully.