aboutsummaryrefslogtreecommitdiff
path: root/extmod/vfs_posix.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2018-07-10 12:51:09 +1000
committerDamien George <damien.p.george@gmail.com>2018-07-10 12:51:09 +1000
commitc700ff52a0e8d5b2a100d1333ea0e0936629fb58 (patch)
treefeab86662eaa14f8b6c348573efaf0abb4c38118 /extmod/vfs_posix.c
parent2cff340357e04cea81153b34fd442839184e8c98 (diff)
extmod/vfs_posix: Support ilistdir with no (or empty) argument.
Diffstat (limited to 'extmod/vfs_posix.c')
-rw-r--r--extmod/vfs_posix.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/extmod/vfs_posix.c b/extmod/vfs_posix.c
index 6e3bb2c5b..2810bdd14 100644
--- a/extmod/vfs_posix.c
+++ b/extmod/vfs_posix.c
@@ -220,6 +220,9 @@ STATIC mp_obj_t vfs_posix_ilistdir(mp_obj_t self_in, mp_obj_t path_in) {
iter->iternext = vfs_posix_ilistdir_it_iternext;
iter->is_str = mp_obj_get_type(path_in) == &mp_type_str;
const char *path = vfs_posix_get_path_str(self, path_in);
+ if (path[0] == '\0') {
+ path = ".";
+ }
iter->dir = opendir(path);
if (iter->dir == NULL) {
mp_raise_OSError(errno);