From e8e338fde7feaaad7ef90459c4f9e673fef1bf58 Mon Sep 17 00:00:00 2001 From: Michael Soegtrop Date: Fri, 11 Aug 2023 12:37:59 +0100 Subject: [PATCH] coqdep: Windows: fix normalisation of paths containing \ --- tools/coqdep/lib/fl.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/coqdep/lib/fl.ml b/tools/coqdep/lib/fl.ml index 8833d94f33f76..8e58715238220 100644 --- a/tools/coqdep/lib/fl.ml +++ b/tools/coqdep/lib/fl.ml @@ -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