aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorTobia Tesan2016-12-26 14:34:22 +0100
committerTobia Tesan2016-12-26 15:09:34 +0100
commita14d3865ad4fbe2cf688e180642bdc5103c5280b (patch)
tree61e5699ffa331f13d59e55a3ce7fb287ddf6be1c /engines
parent257d7e8fe04f942d7c85d27181601774cb853463 (diff)
downloadscummvm-rg350-a14d3865ad4fbe2cf688e180642bdc5103c5280b.tar.gz
scummvm-rg350-a14d3865ad4fbe2cf688e180642bdc5103c5280b.tar.bz2
scummvm-rg350-a14d3865ad4fbe2cf688e180642bdc5103c5280b.zip
WINTERMUTE: Use PathUtil::normalizeFileName in correctSlashes
Diffstat (limited to 'engines')
-rw-r--r--engines/wintermute/base/file/base_disk_file.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/engines/wintermute/base/file/base_disk_file.cpp b/engines/wintermute/base/file/base_disk_file.cpp
index b051c2ec39..30c502665b 100644
--- a/engines/wintermute/base/file/base_disk_file.cpp
+++ b/engines/wintermute/base/file/base_disk_file.cpp
@@ -29,6 +29,7 @@
#include "engines/wintermute/dcgf.h"
#include "engines/wintermute/base/file/base_disk_file.h"
#include "engines/wintermute/base/base_file_manager.h"
+#include "engines/wintermute/utils/path_util.h"
#include "common/stream.h"
#include "common/memstream.h"
#include "common/file.h"
@@ -37,6 +38,7 @@
#include "common/tokenizer.h"
#include "common/config-manager.h"
+
namespace Wintermute {
void correctSlashes(Common::String &fileName) {
@@ -135,14 +137,7 @@ Common::SeekableReadStream *openDiskFile(const Common::String &filename) {
}
// File wasn't found in SearchMan, try to parse the path as a relative path.
if (!file) {
- Common::String filenameBackSlash = filename;
- for (size_t i = 0; i < filenameBackSlash.size(); i++) {
- if (filenameBackSlash[i] == '/') {
- filenameBackSlash.setChar('\\', i);
- }
- }
-
- Common::FSNode searchNode = getNodeForRelativePath(filenameBackSlash);
+ Common::FSNode searchNode = getNodeForRelativePath(PathUtil::normalizeFileName(filename));
if (searchNode.exists() && !searchNode.isDirectory() && searchNode.isReadable()) {
file = searchNode.createReadStream();
}