Skip to content

Commit

Permalink
Windows: fix path normalization in coqdep
Browse files Browse the repository at this point in the history
  • Loading branch information
MSoegtropIMC committed Oct 3, 2024
1 parent d739f8d commit 2b93006
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tools/coqdep/lib/file_util.ml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@

let to_relative_path : string -> string = fun full_path ->
if Filename.is_relative full_path then full_path else
let cwd = String.split_on_char '/' (Sys.getcwd ()) in
let path = String.split_on_char '/' full_path in
let re_delim = if Sys.win32 then "[/\\]" else "/" in
let cwd = Str.split_delim (Str.regexp re_delim) (Sys.getcwd ()) in
let path = Str.split_delim (Str.regexp re_delim) full_path in
let rec remove_common_prefix l1 l2 =
match (l1, l2) with
| (x1 :: l1, x2 :: l2) when x1 = x2 -> remove_common_prefix l1 l2
Expand Down

0 comments on commit 2b93006

Please sign in to comment.