Skip to content

Commit 5d9129a

Browse files
authored
Merge pull request #9314 from dhalbert/workflow-abs-path-fix-2
Further fix to use absolute paths in remote workflows
2 parents d9387bc + e4f6656 commit 5d9129a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

supervisor/shared/filesystem.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,13 @@ fs_user_mount_t *filesystem_for_path(const char *path_in, const char **path_unde
232232
fs_mount = filesystem_circuitpy();
233233
} else {
234234
fs_mount = MP_OBJ_TO_PTR(vfs->obj);
235-
*path_under_mount += strlen(vfs->str);
235+
// Check if the vfs name is one character long: it must be "/" in that case.
236+
// If so don't remove the mount point name. We must use an absolute path
237+
// because otherwise the path will be adjusted by os.getcwd() when it's looked up.
238+
if (strlen(vfs->str) != 1) {
239+
// Remove the mount point directory name, such as "/sd".
240+
path_under_mount += strlen(vfs->str);
241+
}
236242
}
237243
return fs_mount;
238244
}

0 commit comments

Comments
 (0)