Skip to content
Snippets Groups Projects
Commit ef531e26 authored by Andre Maroneze's avatar Andre Maroneze
Browse files

[hdrck] avoid double slashes when concatenating paths

parent a375065f
No related branches found
No related tags found
No related merge requests found
...@@ -135,7 +135,11 @@ let error ~exit_value = ...@@ -135,7 +135,11 @@ let error ~exit_value =
in the header_spec.txt files. in the header_spec.txt files.
*) *)
let path_concat p1 p2 = let path_concat p1 p2 =
p1 ^ "/" ^ p2 (* Note: use String.ends_with when minimum OCaml version is 4.13 *)
if String.length p1 > 0 && String.get p1 (String.length p1 - 1) = '/' then
p1 ^ p2
else
p1 ^ "/" ^ p2
(* Temporary directory management (cont.) *) (* Temporary directory management (cont.) *)
let get_tmp_dirname () = match !tmp_dirname with let get_tmp_dirname () = match !tmp_dirname with
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment