Skip to content

jepath won't work with relative paths which include ".." #169

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

Open
juntuu opened this issue Feb 20, 2021 · 0 comments · May be fixed by #170
Open

jepath won't work with relative paths which include ".." #169

juntuu opened this issue Feb 20, 2021 · 0 comments · May be fixed by #170

Comments

@juntuu
Copy link
Collaborator

juntuu commented Feb 20, 2021

The behaviour is changed when using util::remove_all_occurrences(path, "../");, which does not "back off", but only removes ..s.

jsource/jsrc/jeload.cpp

Lines 147 to 149 in 6ae660d

// remove ./ and backoff ../
util::remove_all_occurrences(path, "../");
util::remove_all_occurrences(path, "./");

This would be easiest to do with std::filesystem::path::lexically_normal.

The broken behaviour now:

Given path: "/one/two/../three/"
expected:   "/one/three/"
actual:     "/one/two/three/"

This then fails to load when given relative path with ..

$> ../build/jsrc/Debug/jconsole
Hello YouTube Viewers, all 22 of you!
ERROR   Could not open library globally: dlopen(<path to>/jsource/jsrc/build/jsrc/Debug/libj.dylib, 1): image not found
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 a pull request may close this issue.

1 participant