diff --git a/sledge/src/llair/loc.ml b/sledge/src/llair/loc.ml index 1f93299c2..3aeccbfb7 100644 --- a/sledge/src/llair/loc.ml +++ b/sledge/src/llair/loc.ml @@ -20,7 +20,10 @@ let root = ref None let pp fs ({dir; file; line; col} as loc) = if not (equal loc none) then Format.pp_print_string fs "; " ; ( if not (String.is_empty dir) then - let dir_file = Fpath.append (Fpath.v dir) (Fpath.v file) in + let dir_file = + if String.is_empty file then Fpath.v dir + else Fpath.append (Fpath.v dir) (Fpath.v file) + in let relative = let* root = !root in let+ relative = Fpath.relativize ~root:(Fpath.v root) dir_file in