options/posix: Change realpath to use strrchr instead of strchr when
removing .. segments from paths
@@ -267,7 +267,7 @@ char *realpath(const char *path, char *out) {
}else if(s_view == "..") {
// Remove a single segment from resolv.
if(resolv.size() > 1) {
- auto slash = strchr(resolv.data(), '/');
+ auto slash = strrchr(resolv.data(), '/');
__ensure(slash); // We never remove the leading sla.
resolv.resize((slash - resolv.data()) + 1);
*slash = 0; // Replace the slash by a null-terminator.
