mirror of
https://github.com/pellepl/spiffs.git
synced 2026-07-27 22:17:47 +00:00
Reset SPIFFS_OBJ_ID_IX_FLAG on obj_id returned by readdir
Same as stat.
This commit is contained in:
@@ -1036,6 +1036,7 @@ struct spiffs_dirent *SPIFFS_readdir(spiffs_DIR *d, struct spiffs_dirent *e) {
|
||||
if (res == SPIFFS_OK) {
|
||||
d->block = bix;
|
||||
d->entry = entry + 1;
|
||||
e->obj_id &= ~SPIFFS_OBJ_ID_IX_FLAG;
|
||||
ret = e;
|
||||
} else {
|
||||
d->fs->err_code = res;
|
||||
|
||||
@@ -427,11 +427,17 @@ TEST(list_dir)
|
||||
break;
|
||||
}
|
||||
}
|
||||
{
|
||||
spiffs_stat s;
|
||||
TEST_CHECK_EQ(SPIFFS_stat(FS, pe->name, &s), 0);
|
||||
TEST_CHECK_EQ(pe->obj_id, s.obj_id);
|
||||
TEST_CHECK_EQ(pe->size, s.size);
|
||||
TEST_CHECK_EQ(pe->type, s.type);
|
||||
TEST_CHECK_EQ(pe->pix, s.pix);
|
||||
#if SPIFFS_OBJ_META_LEN
|
||||
for (i = 0; i < SPIFFS_OBJ_META_LEN; i++) {
|
||||
TEST_CHECK_EQ(pe->meta[i], 0xff);
|
||||
}
|
||||
TEST_CHECK_EQ(memcmp(pe->meta, s.meta, SPIFFS_OBJ_META_LEN), 0);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
SPIFFS_closedir(&d);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user