fix #4. add missing illegal characters

This commit is contained in:
bernardogiordano 2017-10-01 22:27:10 +02:00
parent 13b2766645
commit 15b0df9997
3 changed files with 10 additions and 8 deletions

View file

@ -34,7 +34,7 @@ std::string u16tou8(std::u16string src)
std::u16string removeForbiddenCharacters(std::u16string src)
{
static const std::u16string illegalChars = u8tou16("\\/:?\"<>|");
static const std::u16string illegalChars = u8tou16(".,\\/:?!\"<>|*");
for (size_t i = 0; i < src.length(); i++)
{
if (illegalChars.find(src[i]) != std::string::npos)

View file

@ -39,8 +39,8 @@ bool Title::load(u64 _id, FS_MediaType _media)
shortDescription = removeForbiddenCharacters((char16_t*)smdh->applicationTitles[1].shortDescription);
longDescription = (char16_t*)smdh->applicationTitles[1].longDescription;
backupPath = u8tou16("/Checkpoint/saves/") + shortDescription;
extdataPath = u8tou16("/Checkpoint/extdata/") + shortDescription;
backupPath = u8tou16("/3ds/Checkpoint/saves/") + shortDescription;
extdataPath = u8tou16("/3ds/Checkpoint/extdata/") + shortDescription;
accessibleSave = isSaveAccessible(getMediaType(), getLowId(), getHighId());
accessibleExtdata = isExtdataAccessible(getExtdataId());
@ -70,8 +70,6 @@ bool Title::load(u64 _id, FS_MediaType _media)
}
}
}
refreshDirectories();
if (loadTitle)
{
@ -81,6 +79,9 @@ bool Title::load(u64 _id, FS_MediaType _media)
}
delete smdh;
refreshDirectories();
return loadTitle;
}

View file

@ -44,9 +44,10 @@ void servicesInit(void)
createError(res, "SDMC archive init failed.");
}
mkdir("sdmc:/Checkpoint", 777);
mkdir("sdmc:/Checkpoint/saves", 777);
mkdir("sdmc:/Checkpoint/extdata", 777);
mkdir("sdmc:/3ds", 777);
mkdir("sdmc:/3ds/Checkpoint", 777);
mkdir("sdmc:/3ds/Checkpoint/saves", 777);
mkdir("sdmc:/3ds/Checkpoint/extdata", 777);
pp2d_set_screen_color(GFX_TOP, COLOR_BACKGROUND);
pp2d_set_screen_color(GFX_BOTTOM, COLOR_BACKGROUND);