The behaviour is changed when using util::remove_all_occurrences(path, "../");, which does not "back off", but only removes ..s.
|
// 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
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
This would be easiest to do with
std::filesystem::path::lexically_normal.The broken behaviour now:
This then fails to load when given relative path with
..