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:
Shawn Hoffman 2010-12-10 03:47:00 +00:00
parent 06013d5eec
commit 2ae7f7f01f
1 changed files with 11 additions and 1 deletions

View File

@ -22,6 +22,7 @@
#include "WII_IPC_HLE_Device_fs.h"
#include "WII_IPC_HLE_Device_FileIO.h"
#include <algorithm>
// This is used by several of the FileIO and /dev/fs/ functions
@ -32,7 +33,16 @@ std::string HLE_IPC_BuildFilename(const char* _pFilename, int _size)
std::string Filename = std::string(File::GetUserPath(D_WIIROOT_IDX));
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;