small bugfixes

This commit is contained in:
dborth 2009-10-03 18:43:48 +00:00
parent 571b16daee
commit e095de4e0f
3 changed files with 6 additions and 9 deletions

View File

@ -27,10 +27,9 @@ typedef struct
typedef struct
{
u64 offset; // DVD offset
unsigned int length; // file length
size_t length; // file length
time_t mtime; // file modified time
char isdir; // 0 - file, 1 - directory
int isdir; // 0 - file, 1 - directory
char filename[MAXJOLIET + 1]; // full filename
char displayname[MAXJOLIET + 1]; // name for browser display
int icon; // icon to display

View File

@ -598,6 +598,7 @@ ParseDirectory(bool waitParse)
browserList[0].length = 0;
browserList[0].mtime = 0;
browserList[0].isdir = 1; // flag this as a dir
browserList[0].icon = ICON_FOLDER;
}
parseHalt = false;
@ -663,7 +664,7 @@ LoadSzFile(char * filepath, unsigned char * rbuffer)
file = fopen (filepath, "rb");
if (file > 0)
{
size = SzExtractFile(browserList[browser.selIndex].offset, rbuffer);
size = SzExtractFile(atoi(browserList[browser.selIndex].filename), rbuffer);
fclose (file);
}
else

View File

@ -371,7 +371,6 @@ int SzParse(char * filepath)
// save the length/offset of this file
unsigned int filelen = browserList[browser.selIndex].length;
u64 fileoff = browserList[browser.selIndex].offset;
// setup archive stream
SzArchiveStream.offset = 0;
@ -422,7 +421,6 @@ int SzParse(char * filepath)
// add '..' folder in case the user wants exit the 7z
sprintf(browserList[0].displayname, "Up One Level");
browserList[0].isdir = 1;
browserList[0].offset = fileoff;
browserList[0].length = filelen;
// get contents and parse them into file list structure
@ -452,10 +450,9 @@ int SzParse(char * filepath)
memset(&(browserList[SzJ]), 0, sizeof(BROWSERENTRY)); // clear the new entry
// parse information about this file to the file list structure
strncpy(browserList[SzJ].filename, SzF->Name, MAXJOLIET);
StripExt(browserList[SzJ].displayname, browserList[SzJ].filename);
sprintf(browserList[SzJ].filename, "%d", SzI); // the extraction function identifies the file with this number
StripExt(browserList[SzJ].displayname, SzF->Name);
browserList[SzJ].length = SzF->Size; // filesize
browserList[SzJ].offset = SzI; // the extraction function identifies the file with this number
browserList[SzJ].isdir = 0; // only files will be displayed (-> no flags)
SzJ++;
}