diff --git a/reloc.ml b/reloc.ml index 1f50e83..e402aa7 100644 --- a/reloc.ml +++ b/reloc.ml @@ -1205,8 +1205,8 @@ let normalize_path path = | "." :: path -> loop acc path | ".." :: path -> begin match acc with - | _ :: q -> loop q path - | [] -> loop [".."] path + | previous :: acc when previous <> ".." -> loop acc path + | _ -> loop (".." :: acc) path end | elem :: path -> loop (elem :: acc) path | [] -> List.rev acc