summaryrefslogtreecommitdiff
path: root/py/objobject.c
diff options
context:
space:
mode:
authorChristian Walther <cwalther@gmx.ch>2023-07-30 14:48:22 +0200
committerChristian Walther <cwalther@gmx.ch>2023-10-19 16:21:09 +0200
commitbe28829ae8d22e1a0373bda116022ee446fb2ed8 (patch)
tree096b53d36c4d123e937cf8c6a9779ffd8a905aac /py/objobject.c
parent0c4fb1687193a6c6f5edbb9404ecb7e5d6f3bec3 (diff)
extmod/vfs_posix: Fix getcwd() on non-root VFS.
The unwritten API contract expected of a VFS.getcwd() by mp_vfs_getcwd() is that its return value should be either "" or "/" when the CWD is at the root of the VFS and otherwise start with a slash and not end with a slash. This was not correctly implemented in VfsPosix for instances with a non-empty root - the required leading slash, if any, was cut off because the root length includes a trailing slash. This would result in missing slashes in the middle of the return value of os.getcwd() or in uninitialized garbage from beyond a string's null terminator when the CWD was at the VFS root. Signed-off-by: Christian Walther <cwalther@gmx.ch>
Diffstat (limited to 'py/objobject.c')
0 files changed, 0 insertions, 0 deletions