Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix WASI Path Mapping Processing #3923

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dpjohnst
Copy link

Filesystem paths can be mapped from the host path to a guest path using the format <guest-path>::<host-path>.

Previously strtok was used to find the :: delimiter. Unfortunately strtok processes each delimiter character individually. This meant that the code was ~equivalent to strtok(mapping_copy, ":") which breaks with Windows-style paths (E.g. C:\my_path\).

To fix this strstr is used to search for the exact delimiter.

Filesystem paths can be mapped from the host path to a guest path using
the format `<guest-path>::<host-path>`.

Previously `strtok` was used to find the `::` delimiter. Unfortunately
`strtok` processes each delimiter character individually. This meant
that the code was ~equivalent to `strtok(mapping_copy, ":")` which
breaks with Windows-style paths (E.g. `C:\my_path\`).

To fix this `strstr` is used to search for the exact delimiter.
@dpjohnst dpjohnst marked this pull request as ready for review November 21, 2024 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant