Skip to content

Commit

Permalink
coqdep: Windows: fix normalisation of paths containing \
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Soegtrop committed Aug 11, 2023
1 parent 18722d2 commit e8e338f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/coqdep/lib/fl.ml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ let to_relative_path : string -> string = fun full_path ->
["../../dir/file.v"] are possible return values, but ["./file.v"] and
["dir1/../dir2"] are not. *)
let normalize_path : string -> string = fun path ->
let path = String.split_on_char '/' path in
let re_delim = if Sys.win32 then "[/\\]" else "/" in
let path = Str.split_delim (Str.regexp re_delim) path in
let rec normalize acc path =
match (path, acc) with
| ([] , _ ) -> List.rev acc
Expand Down

0 comments on commit e8e338f

Please sign in to comment.