1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-23 19:21:59 +03:00

Fix SPIFFS.openDir("") (#2143)

* Update spiffs_api.cpp

Fixes a bug where un-prefixed files are irretrievable with openDir(""). Described: https://github.com/esp8266/Arduino/issues/1818.

* Update FS test cases
This commit is contained in:
Ivan Grokhotkov
2016-06-14 07:15:55 +08:00
committed by GitHub
parent 91720337d3
commit b9dfe01903
2 changed files with 16 additions and 5 deletions

View File

@ -63,9 +63,9 @@ bool SPIFFSImpl::exists(const char* path)
return rc == SPIFFS_OK;
}
DirImplPtr SPIFFSImpl::openDir(const char* path)
DirImplPtr SPIFFSImpl::openDir(const char* path)
{
if (!isSpiffsFilenameValid(path)) {
if (strlen(path) > 0 && !isSpiffsFilenameValid(path)) {
DEBUGV("SPIFFSImpl::openDir: invalid path=`%s` \r\n", path);
return DirImplPtr();
}