Patch by Magliocchetti Riccardo:

Removed shadow on fpath.
This commit is contained in:
yabause 2008-11-10 21:47:21 +00:00
parent dfb4ada998
commit 54f56cb716
1 changed files with 5 additions and 5 deletions

View File

@ -248,7 +248,7 @@ static void add_file(char *fname, FsEntry * entry, int fileLevel) {
/* List all files and subdirectories recursively */ /* List all files and subdirectories recursively */
static void list_files(char *fpath) { static void list_files(const char *filepath) {
void * hFind; void * hFind;
FsEntry entry; FsEntry entry;
char DirSpec[255 + 1],SubDir[255+1]; char DirSpec[255 + 1],SubDir[255+1];
@ -259,7 +259,7 @@ static void list_files(char *fpath) {
maxLevel++; maxLevel++;
fileLevel = maxLevel; fileLevel = maxLevel;
strncpy(DirSpec, fpath, ARRAY_SIZE(DirSpec)); strncpy(DirSpec, filepath, ARRAY_SIZE(DirSpec));
DirSpec[255] = 0 ; /* hard limit the string here */ DirSpec[255] = 0 ; /* hard limit the string here */
hFind = FsReadFirst(DirSpec, &entry); hFind = FsReadFirst(DirSpec, &entry);
@ -277,9 +277,9 @@ static void list_files(char *fpath) {
if (numFiles==MAXFILES-1) break; if (numFiles==MAXFILES-1) break;
if ((entry.flags & FS_IS_DIR) && (strcmp(fname, ".")) && (strcmp(fname, ".."))) { if ((entry.flags & FS_IS_DIR) && (strcmp(fname, ".")) && (strcmp(fname, ".."))) {
if (strlen(fname)+strlen(fpath)+2 < 256) if (strlen(fname)+strlen(filepath)+2 < 256)
{ {
sprintf(SubDir, "%s%c%s", fpath, FS_SEPARATOR, fname); sprintf(SubDir, "%s%c%s", filepath, FS_SEPARATOR, fname);
list_files(SubDir); list_files(SubDir);
} }
} }
@ -313,7 +313,7 @@ static BOOL cflash_build_fat( void) {
fileLevel = -1; fileLevel = -1;
maxLevel = -1; maxLevel = -1;
sRomPath = szRomPath; // From MMU.cpp sRomPath = szRomPath; // From MMU.cpp
files = (DIR_ENT *) malloc(MAXFILES*sizeof(DIR_ENT)); files = (DIR_ENT *) malloc(MAXFILES*sizeof(DIR_ENT));
if (files == NULL) if (files == NULL)
return FALSE; return FALSE;