mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
AP_Filesystem: don't show directory entries for empty @ filesystems
This commit is contained in:
parent
21edc6aee1
commit
2cb5f434fd
@ -242,6 +242,14 @@ struct dirent *AP_Filesystem::readdir(DirHandle *dirp)
|
|||||||
if (prefix[0] != '@') {
|
if (prefix[0] != '@') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// only return @ entries in root if we can successfully opendir them:
|
||||||
|
auto *d = backends[virtual_dirent.backend_ofs].fs.opendir("");
|
||||||
|
if (d == nullptr) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
backends[virtual_dirent.backend_ofs].fs.closedir(d);
|
||||||
|
|
||||||
// found a virtual directory we haven't returned yet
|
// found a virtual directory we haven't returned yet
|
||||||
strncpy_noterm(virtual_dirent.de.d_name, prefix, sizeof(virtual_dirent.de.d_name));
|
strncpy_noterm(virtual_dirent.de.d_name, prefix, sizeof(virtual_dirent.de.d_name));
|
||||||
virtual_dirent.d_off++;
|
virtual_dirent.d_off++;
|
||||||
|
Loading…
Reference in New Issue
Block a user