Revision 184
Added by markw almost 11 years ago
firmware/fat/pff_file.c | ||
---|---|---|
prev->size = 0;
|
||
prev->is_subdir = 1;
|
||
prev->is_readonly = 1;
|
||
prev->next = 0;
|
||
--room;
|
||
|
||
//int count=0;
|
||
struct SimpleDirEntry * entry = 0;
|
||
while (FR_OK == pf_readdir(&dir,&filinfo) && filinfo.fname[0]!='\0')
|
||
struct SimpleDirEntry * entry = prev + 1;
|
||
while (room && FR_OK == pf_readdir(&dir,&filinfo) && filinfo.fname[0]!='\0')
|
||
{
|
||
char * ptr;
|
||
|
||
... | ... | |
continue;
|
||
}
|
||
|
||
if (room)
|
||
{
|
||
entry = prev+1;
|
||
--room;
|
||
}
|
||
else
|
||
{
|
||
//printf("OUT of room!\n");
|
||
break; // OUT OF ROOM!
|
||
}
|
||
|
||
//printf("next %x %d ",entry,room);
|
||
|
||
entry->is_subdir = (filinfo.fattrib & AM_DIR) ? 1 : 0;
|
||
... | ... | |
//int count;
|
||
//printf("%d %s %s\n",count++, filinfo.fname, filinfo.lfname);
|
||
|
||
entry->next = 0;
|
||
|
||
if (filter && !filter(entry))
|
||
{
|
||
continue;
|
||
continue;
|
||
}
|
||
|
||
entry->next = 0;
|
||
|
||
if (prev)
|
||
prev->next = entry;
|
||
prev = entry;
|
||
entry++;
|
||
room--;
|
||
|
||
//printf("n %d %d %x ",filinfo.fsize, entry->size, entry->next);
|
||
}
|
||
|
||
//printf("dir_entries done ");
|
||
|
||
entry->next = 0;
|
||
|
||
/*struct SimpleDirEntry * begin = (struct SimpleDirEntry *) dir_cache;
|
||
int count = 0;
|
||
while (begin)
|
Also available in: Unified diff
Patch from Hias to fix case where linked list is not terminated. 0001-fix-directory-reading.patch