mirror of
https://github.com/rvtr/GodMode9i.git
synced 2025-11-02 00:11:07 -04:00
Remove unsupported characters when renaming a folder
This commit is contained in:
parent
35583045b2
commit
5b3b31f743
@ -714,6 +714,21 @@ string browseForFile (void) {
|
||||
consoleInit(&bottomConsole, 0, BgType_Text4bpp, BgSize_T_256x256, 15, 0, false, true);
|
||||
|
||||
if (newName[0] != '\0') {
|
||||
// Check for unsupported characters
|
||||
for (int i = 0; i < (int)sizeof(newName); i++) {
|
||||
if (newName[i] == '>'
|
||||
|| newName[i] == '<'
|
||||
|| newName[i] == ':'
|
||||
|| newName[i] == '"'
|
||||
|| newName[i] == '/'
|
||||
|| newName[i] == '\x5C'
|
||||
|| newName[i] == '|'
|
||||
|| newName[i] == '?'
|
||||
|| newName[i] == '*')
|
||||
{
|
||||
newName[i] = '_'; // Remove unsupported character
|
||||
}
|
||||
}
|
||||
if (mkdir(newName, 0777) == 0) {
|
||||
getDirectoryContents (dirContents);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user