diff --git a/Core/FileSystems/ISOFileSystem.cpp b/Core/FileSystems/ISOFileSystem.cpp index d779a3035e..2082472475 100644 --- a/Core/FileSystems/ISOFileSystem.cpp +++ b/Core/FileSystems/ISOFileSystem.cpp @@ -187,10 +187,18 @@ nextblock: name[i] = buffer[33+i] ? buffer[33+i] : '.'; name[fnLength] = '\0'; + bool relative = false; + if (!strcmp(name, ".")) // "." record - continue; + { + relative = true; + } + if (strlen(name) == 1 && name[0] == '\x01') // ".." record - continue; + { + strcpy(name,".."); + relative=true; + } TreeEntry *e = new TreeEntry; e->name = name; @@ -202,7 +210,7 @@ nextblock: DEBUG_LOG(FILESYS, "%s: %s %08x %08x %i", e->isDirectory?"D":"F", name, dir.firstDataSectorLE, e->startingPosition, e->startingPosition); - if (e->isDirectory) + if (e->isDirectory && !relative) { if (dir.firstDataSectorLE == startsector) { @@ -500,18 +508,13 @@ std::vector ISOFileSystem::GetDirListing(std::string path) return myVector; } - // fake the . and .. - PSPFileInfo x; - x.type = FILETYPE_DIRECTORY; - x.name = "."; - x.isOnSectorSystem = true; - myVector.push_back(x); - x.name = ".."; - myVector.push_back(x); - for (size_t i=0; ichildren.size(); i++) { TreeEntry *e = entry->children[i]; + + if(!strcmp(e->name, ".") || !strcmp(e->name, "..")) // do not include the relative entries in the list + continue; + PSPFileInfo x; x.name = e->name; x.access = FILEACCESS_READ; diff --git a/Core/HLE/sceKernelModule.cpp b/Core/HLE/sceKernelModule.cpp index 5b1017a392..b89200c17b 100644 --- a/Core/HLE/sceKernelModule.cpp +++ b/Core/HLE/sceKernelModule.cpp @@ -553,6 +553,9 @@ void sceKernelLoadExec() u32 sceKernelLoadModule(const char *name, u32 flags) { + if(!name) + return 0; + PSPFileInfo info = pspFileSystem.GetFileInfo(name); std::string error_string; s64 size = (s64)info.size; diff --git a/Windows/ppsspp.rc b/Windows/ppsspp.rc index 48374c020b..e6fb9af450 100644 --- a/Windows/ppsspp.rc +++ b/Windows/ppsspp.rc @@ -7,7 +7,8 @@ // // Generated from the TEXTINCLUDE 2 resource. // -#include "afxres.h" +#include "afxres.h" + ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS @@ -414,7 +415,8 @@ END // // Generated from the TEXTINCLUDE 3 resource. // - + + ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED