small bugfixes

This commit is contained in:
dborth 2009-10-03 18:44:09 +00:00
parent a0202eca85
commit e36d4f5db0
3 changed files with 6 additions and 9 deletions

View File

@ -30,10 +30,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

@ -599,6 +599,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;
@ -664,7 +665,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

@ -372,7 +372,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;
@ -423,7 +422,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
@ -453,10 +451,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++;
}