Merge pull request #29 from gigaherz/little-changes

Little changes
This commit is contained in:
Henrik Rydgård 2012-11-10 03:38:45 -08:00
commit c7b90ca7c0
3 changed files with 22 additions and 14 deletions

View File

@ -187,10 +187,18 @@ nextblock:
name[i] = buffer[33+i] ? buffer[33+i] : '.'; name[i] = buffer[33+i] ? buffer[33+i] : '.';
name[fnLength] = '\0'; name[fnLength] = '\0';
bool relative = false;
if (!strcmp(name, ".")) // "." record if (!strcmp(name, ".")) // "." record
continue; {
relative = true;
}
if (strlen(name) == 1 && name[0] == '\x01') // ".." record if (strlen(name) == 1 && name[0] == '\x01') // ".." record
continue; {
strcpy(name,"..");
relative=true;
}
TreeEntry *e = new TreeEntry; TreeEntry *e = new TreeEntry;
e->name = name; 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); 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) if (dir.firstDataSectorLE == startsector)
{ {
@ -500,18 +508,13 @@ std::vector<PSPFileInfo> ISOFileSystem::GetDirListing(std::string path)
return myVector; 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; i<entry->children.size(); i++) for (size_t i=0; i<entry->children.size(); i++)
{ {
TreeEntry *e = entry->children[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; PSPFileInfo x;
x.name = e->name; x.name = e->name;
x.access = FILEACCESS_READ; x.access = FILEACCESS_READ;

View File

@ -553,6 +553,9 @@ void sceKernelLoadExec()
u32 sceKernelLoadModule(const char *name, u32 flags) u32 sceKernelLoadModule(const char *name, u32 flags)
{ {
if(!name)
return 0;
PSPFileInfo info = pspFileSystem.GetFileInfo(name); PSPFileInfo info = pspFileSystem.GetFileInfo(name);
std::string error_string; std::string error_string;
s64 size = (s64)info.size; s64 size = (s64)info.size;

View File

@ -7,7 +7,8 @@
// //
// Generated from the TEXTINCLUDE 2 resource. // Generated from the TEXTINCLUDE 2 resource.
// //
#include "afxres.h" #include "afxres.h"
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS #undef APSTUDIO_READONLY_SYMBOLS
@ -414,7 +415,8 @@ END
// //
// Generated from the TEXTINCLUDE 3 resource. // Generated from the TEXTINCLUDE 3 resource.
// //
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED #endif // not APSTUDIO_INVOKED