diff options
| author | robert <robert@hammelrath.com> | 2020-04-29 18:13:22 +0200 |
|---|---|---|
| committer | Damien George <damien.p.george@gmail.com> | 2020-05-08 21:37:51 +1000 |
| commit | a5ea4b9f3f3fd394afdf65223b5e55c8d9fccc53 (patch) | |
| tree | b5bf89a068d617cbd5785e2b54f4a6d4c2f0dbfa /extmod | |
| parent | 037c83b0ed47abe68c47c8fa617fdc0041b699f0 (diff) | |
extmod/vfs_lfsx: Fix path handling in uos.stat() to consider cur dir.
This fixes the bug, that stat(filename) would not consider the current
working directory. So if e.g. the cwd is "lib", then stat("main.py") would
return the info for "/main.py" instead of "/lib/main.py".
Diffstat (limited to 'extmod')
| -rw-r--r-- | extmod/vfs_lfsx.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/extmod/vfs_lfsx.c b/extmod/vfs_lfsx.c index b381056b8..9474e960f 100644 --- a/extmod/vfs_lfsx.c +++ b/extmod/vfs_lfsx.c @@ -304,7 +304,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(MP_VFS_LFSx(getcwd_obj), MP_VFS_LFSx(getcwd)); STATIC mp_obj_t MP_VFS_LFSx(stat)(mp_obj_t self_in, mp_obj_t path_in) { MP_OBJ_VFS_LFSx *self = MP_OBJ_TO_PTR(self_in); - const char *path = mp_obj_str_get_str(path_in); + const char *path = MP_VFS_LFSx(make_path)(self, path_in); struct LFSx_API (info) info; int ret = LFSx_API(stat)(&self->lfs, path, &info); if (ret < 0) { |
