subsys/fs: correct misinterpretation of Zephyr API
The Zephyr fs readdir abstraction returns OK with a zero-length file name when the last directory entry has been found. The loop to build multiple entries instead checked for a non-file entry type. Correct the loop exit condition. Signed-off-by: Peter A. Bigot <pab@pabigot.com>
This commit is contained in:
parent
9b993bef6b
commit
452d3dea7a
|
@ -261,6 +261,9 @@ int fs_readdir(struct fs_dir_t *zdp, struct fs_dirent *entry)
|
|||
if (rc < 0) {
|
||||
break;
|
||||
}
|
||||
if (entry->name[0] == 0) {
|
||||
break;
|
||||
}
|
||||
if (entry->type != FS_DIR_ENTRY_DIR) {
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue