1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-19 23:22:16 +03:00

Skip . and .. on LittleFS::dir::rewind() (#6959)

Fixes #6958

To match SPIFFS, we get rid of the "." and ".." dirents when we open a
directory on LittleFS.  Do the same on a rewind().
This commit is contained in:
Earle F. Philhower, III 2019-12-30 14:23:14 -08:00 committed by GitHub
parent 5d5200af41
commit 2492043669
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -567,6 +567,10 @@ public:
bool rewind() override {
_valid = false;
int rc = lfs_dir_rewind(_fs->getFS(), _getDir());
// Skip the . and .. entries
lfs_info dirent;
lfs_dir_read(_fs->getFS(), _getDir(), &dirent);
lfs_dir_read(_fs->getFS(), _getDir(), &dirent);
return (rc == 0);
}