Skip to content

Commit c700ff5

Browse files
committed
extmod/vfs_posix: Support ilistdir with no (or empty) argument.
1 parent 2cff340 commit c700ff5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

extmod/vfs_posix.c

+3
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,9 @@ STATIC mp_obj_t vfs_posix_ilistdir(mp_obj_t self_in, mp_obj_t path_in) {
220220
iter->iternext = vfs_posix_ilistdir_it_iternext;
221221
iter->is_str = mp_obj_get_type(path_in) == &mp_type_str;
222222
const char *path = vfs_posix_get_path_str(self, path_in);
223+
if (path[0] == '\0') {
224+
path = ".";
225+
}
223226
iter->dir = opendir(path);
224227
if (iter->dir == NULL) {
225228
mp_raise_OSError(errno);

0 commit comments

Comments
 (0)