summaryrefslogtreecommitdiff
path: root/extmod/vfs_posix.c
diff options
context:
space:
mode:
authorJeremy Rand <jeremy@rand-family.com>2023-03-16 21:27:05 -0400
committerDamien George <damien@micropython.org>2023-03-21 16:13:10 +1100
commitd677023b3decec2f10d6b00b84b34032db4a0fd4 (patch)
tree5765ffe91dba0b8325293a88a5cfa351cbac5a64 /extmod/vfs_posix.c
parent051e2900d97e6727034b4b59f18ec7abc517c9a8 (diff)
extmod/vfs_posix: Do not filter '..*' in ilistdir when filtering '..'.
When iterating over os.ilistdir(), the special directories '.' and '..' are filtered from the results. But the code inadvertently also filtered any file/directory which happened to match '..*'. This change fixes the filter. Fixes issue #11032. Signed-off-by: Jeremy Rand <jeremy@rand-family.com>
Diffstat (limited to 'extmod/vfs_posix.c')
-rw-r--r--extmod/vfs_posix.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/extmod/vfs_posix.c b/extmod/vfs_posix.c
index 0a8274373..9b856e1f0 100644
--- a/extmod/vfs_posix.c
+++ b/extmod/vfs_posix.c
@@ -192,7 +192,7 @@ STATIC mp_obj_t vfs_posix_ilistdir_it_iternext(mp_obj_t self_in) {
MP_THREAD_GIL_ENTER();
const char *fn = dirent->d_name;
- if (fn[0] == '.' && (fn[1] == 0 || fn[1] == '.')) {
+ if (fn[0] == '.' && (fn[1] == 0 || (fn[1] == '.' && fn[2] == 0))) {
// skip . and ..
continue;
}