Merge pull request #4186 from geky/fs-dot-entries

Filesystem: Include '.' and '..' in directory iteration
pull/4274/head
Anna Bridge 2017-05-04 15:55:41 +01:00 committed by GitHub
commit e2469ecbba
2 changed files with 8 additions and 2 deletions

View File

@ -116,7 +116,13 @@ void test_read_dir() {
while ((de = readdir(&dir))) {
printf("d_name: %.32s, d_type: %x\n", de->d_name, de->d_type);
if (strcmp(de->d_name, "test_dir") == 0) {
if (strcmp(de->d_name, ".") == 0) {
test_dir_found = true;
TEST_ASSERT_EQUAL(DT_DIR, de->d_type);
} else if (strcmp(de->d_name, "..") == 0) {
test_dir_found = true;
TEST_ASSERT_EQUAL(DT_DIR, de->d_type);
} else if (strcmp(de->d_name, "test_dir") == 0) {
test_dir_found = true;
TEST_ASSERT_EQUAL(DT_DIR, de->d_type);
} else if (strcmp(de->d_name, "test_file") == 0) {

View File

@ -126,7 +126,7 @@
/ When _LFN_UNICODE is 0, this option has no effect. */
#define _FS_RPATH 0
#define _FS_RPATH 1
/* This option configures relative path feature.
/
/ 0: Disable relative path feature and remove related functions.