simplify list files, ensure all entries get recursed
This commit is contained in:
parent
17f9e422d3
commit
651672bf7a
|
@ -56,11 +56,7 @@ static void list_files(const char *filepath, ListCallback list_callback)
|
||||||
hFind = FsReadFirst(DirSpec, &entry);
|
hFind = FsReadFirst(DirSpec, &entry);
|
||||||
if (hFind == NULL) return;
|
if (hFind == NULL) return;
|
||||||
|
|
||||||
fname = (strlen(entry.cAlternateFileName)>0) ? entry.cAlternateFileName : entry.cFileName;
|
do {
|
||||||
list_callback(&entry,EListCallbackArg_Item);
|
|
||||||
|
|
||||||
while (FsReadNext(hFind, &entry) != 0)
|
|
||||||
{
|
|
||||||
fname = (strlen(entry.cAlternateFileName)>0) ? entry.cAlternateFileName : entry.cFileName;
|
fname = (strlen(entry.cAlternateFileName)>0) ? entry.cAlternateFileName : entry.cFileName;
|
||||||
list_callback(&entry,EListCallbackArg_Item);
|
list_callback(&entry,EListCallbackArg_Item);
|
||||||
printf("cflash added %s\n",entry.cFileName);
|
printf("cflash added %s\n",entry.cFileName);
|
||||||
|
@ -74,7 +70,7 @@ static void list_files(const char *filepath, ListCallback list_callback)
|
||||||
list_callback(&entry, EListCallbackArg_Pop);
|
list_callback(&entry, EListCallbackArg_Pop);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} while (FsReadNext(hFind, &entry) != 0);
|
||||||
|
|
||||||
dwError = FsError();
|
dwError = FsError();
|
||||||
FsClose(hFind);
|
FsClose(hFind);
|
||||||
|
|
Loading…
Reference in New Issue