mirror of
https://github.com/wiiu-env/libfat.git
synced 2024-11-29 13:14:17 +01:00
make dirnext return 0 for success & -1 for error/no more files
This commit is contained in:
parent
537cb4c6d7
commit
e64acc0133
@ -508,7 +508,8 @@ int _FAT_dirnext_r (struct _reent *r, DIR_ITER *dirState, char *filename, struct
|
|||||||
|
|
||||||
// Make sure there is another file to report on
|
// Make sure there is another file to report on
|
||||||
if (! state->validEntry) {
|
if (! state->validEntry) {
|
||||||
return 0;
|
r->_errno = ENOENT;
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the filename
|
// Get the filename
|
||||||
@ -522,7 +523,7 @@ int _FAT_dirnext_r (struct _reent *r, DIR_ITER *dirState, char *filename, struct
|
|||||||
state->validEntry =
|
state->validEntry =
|
||||||
_FAT_directory_getNextEntry (state->partition, &(state->currentEntry));
|
_FAT_directory_getNextEntry (state->partition, &(state->currentEntry));
|
||||||
|
|
||||||
return 1;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int _FAT_dirclose_r (struct _reent *r, DIR_ITER *dirState) {
|
int _FAT_dirclose_r (struct _reent *r, DIR_ITER *dirState) {
|
||||||
|
Loading…
Reference in New Issue
Block a user