From 05a95db4dbde94cbdd0c5cde10aae7479e245960 Mon Sep 17 00:00:00 2001 From: "overjoy.psm" Date: Sat, 12 May 2012 23:49:00 +0000 Subject: [PATCH] *Reverted something that was introduced in r341. Nand emulation should now work again. --- source/channel/nand.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/source/channel/nand.cpp b/source/channel/nand.cpp index d68d9607..f9eb63d7 100644 --- a/source/channel/nand.cpp +++ b/source/channel/nand.cpp @@ -188,13 +188,15 @@ void Nand::Set_NandPath(string path) if(isalnum(*(path.end()))) path.push_back('/'); else - path.replace(path.length() - 1, 1, "/"); + //path.replace(path.length() - 1, 1, "/"); WTF? + *(path.end()) = '/'; if(path.size() <= 32) memcpy(NandPath, path.c_str(), path.size()); else memset(NandPath, 0, sizeof(NandPath)); -gprintf("NandPath = %s\n", NandPath); + + gprintf("NandPath = %s\n", NandPath); } void Nand::__Dec_Enc_TB(void) @@ -811,8 +813,11 @@ void Nand::CreateTitleTMD(const char *path, dir_discHdr *hdr) CreatePath("%s/title/%08x/%08x/content", path, highTID, lowTID); char nandpath[MAX_FAT_PATH]; - snprintf(nandpath, sizeof(nandpath), "%s/title/%08x/%08x/content/title.tmd", path, highTID, lowTID); - + if(path[strlen(path)-1] == '/') + snprintf(nandpath, sizeof(nandpath), "%stitle/%08x/%08x/content/title.tmd", path, highTID, lowTID); + else + snprintf(nandpath, sizeof(nandpath), "%s/title/%08x/%08x/content/title.tmd", path, highTID, lowTID); + struct stat filestat; if (stat(nandpath, &filestat) == 0) {