mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-03 09:23:37 +00:00
WINTERMUTE: Use PathUtil::normalizeFileName in correctSlashes
This commit is contained in:
parent
257d7e8fe0
commit
a14d3865ad
@ -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();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user