From 0ec60829e63bd2f3e89a8a3be00e80db821ba6e2 Mon Sep 17 00:00:00 2001 From: Boris Yakobowski Date: Fri, 29 Mar 2019 14:56:33 +0100 Subject: [PATCH] S308-026 be more forgiving with relative paths in search dirs We should only get absolute library paths in search dirs, but sometimes we currently get ./../lib. Accept this case Change-Id: I8c0710dcbe9c2c8690070a190f16c84025559dc3 --- reloc.ml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/reloc.ml b/reloc.ml index 0eeb794..2b36ab7 100644 --- a/reloc.ml +++ b/reloc.ml @@ -1217,7 +1217,11 @@ let normalize_path path = let rec loop acc path = match path with | "." :: path -> loop acc path - | ".." :: path -> loop (List.tl acc) path + | ".." :: path -> begin + match acc with + | ".." :: _ | [] -> loop (".." :: acc) path + | _ :: acc -> loop acc path + end | elem :: path -> loop (elem :: acc) path | [] -> List.rev acc in