mirror of
https://github.com/wiiu-env/libfat.git
synced 2024-11-22 01:49: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
|
||||
if (! state->validEntry) {
|
||||
return 0;
|
||||
r->_errno = ENOENT;
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Get the filename
|
||||
@ -522,7 +523,7 @@ int _FAT_dirnext_r (struct _reent *r, DIR_ITER *dirState, char *filename, struct
|
||||
state->validEntry =
|
||||
_FAT_directory_getNextEntry (state->partition, &(state->currentEntry));
|
||||
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int _FAT_dirclose_r (struct _reent *r, DIR_ITER *dirState) {
|
||||
|
Loading…
Reference in New Issue
Block a user