jsource
jsource copied to clipboard
jepath won't work with relative paths which include ".."
The behaviour is changed when using util::remove_all_occurrences(path, "../");, which does not "back off", but only removes ..s.
https://github.com/codereport/jsource/blob/6ae660de8bff9db8d3e000bd4f25974acf17d09f/jsrc/jeload.cpp#L147-L149
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