Replace characters that NTFS and HFS can't handle with '-'. Should fix issue 3443.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6545 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
06013d5eec
commit
2ae7f7f01f
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
#include "WII_IPC_HLE_Device_fs.h"
|
#include "WII_IPC_HLE_Device_fs.h"
|
||||||
#include "WII_IPC_HLE_Device_FileIO.h"
|
#include "WII_IPC_HLE_Device_FileIO.h"
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
|
|
||||||
// This is used by several of the FileIO and /dev/fs/ functions
|
// This is used by several of the FileIO and /dev/fs/ functions
|
||||||
|
@ -34,6 +35,15 @@ std::string HLE_IPC_BuildFilename(const char* _pFilename, int _size)
|
||||||
if (Buffer[1] == '0')
|
if (Buffer[1] == '0')
|
||||||
Filename += std::string("/title"); // this looks and feel like a hack...
|
Filename += std::string("/title"); // this looks and feel like a hack...
|
||||||
|
|
||||||
|
// Replaces chars that NTFS can't support with '-'. TODO '/', '\' ?
|
||||||
|
std::replace(Buffer, Buffer + _size, '"', '-');
|
||||||
|
std::replace(Buffer, Buffer + _size, '*', '-');
|
||||||
|
std::replace(Buffer, Buffer + _size, ':', '-');
|
||||||
|
std::replace(Buffer, Buffer + _size, '<', '-');
|
||||||
|
std::replace(Buffer, Buffer + _size, '>', '-');
|
||||||
|
std::replace(Buffer, Buffer + _size, '?', '-');
|
||||||
|
std::replace(Buffer, Buffer + _size, '|', '-');
|
||||||
|
|
||||||
Filename += Buffer;
|
Filename += Buffer;
|
||||||
|
|
||||||
return Filename;
|
return Filename;
|
||||||
|
|
Loading…
Reference in New Issue