summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorShawn Hoffman <godisgovernment@gmail.com>2010-12-10 03:47:00 +0000
committerShawn Hoffman <godisgovernment@gmail.com>2010-12-10 03:47:00 +0000
commit2ae7f7f01f96c3a4d07e22525fcfda12c83e070b (patch)
treed4bf605a2d19fbce213709252d22cae339974915 /Source/Core
parent06013d5eec9a906f9d64df4de50a1ca2cc3adeea (diff)
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
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp
index 9628a6dd28..2b5e6ebe21 100644
--- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp
+++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp
@@ -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;