Skip to content

Conversation

@seclorum
Copy link

Fixes a bug where un-prefixed files are irretrievable with openDir(""). Described: #1818.

Fixes a bug where un-prefixed files are irretrievable with openDir(""). Described: esp8266#1818.
@igrr
Copy link
Member

igrr commented Mar 26, 2016

You may need to update the test as well. Old behaviour (openDir("") should return empty list) was checked here: https://github.com/esp8266/Arduino/blob/master/tests/host/fs/test_fs.cpp#L163-L164

@hallard
Copy link
Contributor

hallard commented Mar 29, 2016

Just my 2 cents, why not change the original isSpiffsFilenameValid where is the problem, checking len >0 by adding *name == 0 in the 1st if, like this ?

bool isSpiffsFilenameValid(const char* name)
{
    if (name == nullptr || *name == 0) {
        return false;
    }
    auto len = strlen(name);
    return len > 0 && len < SPIFFS_OBJ_NAME_LEN;
}

original is currently

bool isSpiffsFilenameValid(const char* name)
{
    if (name == nullptr) {
        return false;
    }
    auto len = strlen(name);
    return len > 0 && len < SPIFFS_OBJ_NAME_LEN;
}```

@ghost
Copy link

ghost commented Apr 11, 2016

Can one of the admins verify this patch?

@igrr igrr mentioned this pull request Jun 13, 2016
@igrr
Copy link
Member

igrr commented Jun 13, 2016

Reopened as #2143, with test cases fixed.

@igrr igrr closed this Jun 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants