fix: Trailing . and .. fix

This commit is contained in:
2025-09-07 18:50:02 +01:00
parent 5826e168d0
commit c94ea76243

View File

@@ -130,7 +130,7 @@ fn do_remove_dot_segments(path: String, acc: String) -> String {
"/." -> acc <> "/"
"/../" <> rest -> do_remove_dot_segments("/" <> rest, remove_segment(acc))
"/.." -> remove_segment(acc) <> "/"
"." | ".." | "" -> acc
"." | ".." | "" -> acc <> path
_ -> {
let assert Ok(#(char, rest)) = string.pop_grapheme(path)
do_remove_dot_segments(rest, acc <> char)