Skip to content

Commit e2469ec

Browse files
authored
Merge pull request #4186 from geky/fs-dot-entries
Filesystem: Include '.' and '..' in directory iteration
2 parents 9a3122a + fd80dcc commit e2469ec

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

features/TESTS/filesystem/fat_filesystem/main.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,13 @@ void test_read_dir() {
116116
while ((de = readdir(&dir))) {
117117
printf("d_name: %.32s, d_type: %x\n", de->d_name, de->d_type);
118118

119-
if (strcmp(de->d_name, "test_dir") == 0) {
119+
if (strcmp(de->d_name, ".") == 0) {
120+
test_dir_found = true;
121+
TEST_ASSERT_EQUAL(DT_DIR, de->d_type);
122+
} else if (strcmp(de->d_name, "..") == 0) {
123+
test_dir_found = true;
124+
TEST_ASSERT_EQUAL(DT_DIR, de->d_type);
125+
} else if (strcmp(de->d_name, "test_dir") == 0) {
120126
test_dir_found = true;
121127
TEST_ASSERT_EQUAL(DT_DIR, de->d_type);
122128
} else if (strcmp(de->d_name, "test_file") == 0) {

features/filesystem/fat/ChaN/ffconf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
/ When _LFN_UNICODE is 0, this option has no effect. */
127127

128128

129-
#define _FS_RPATH 0
129+
#define _FS_RPATH 1
130130
/* This option configures relative path feature.
131131
/
132132
/ 0: Disable relative path feature and remove related functions.

0 commit comments

Comments
 (0)