From dacfa6cc8e24b7f1ef959c308fa41e79dafbcb07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Gilbert?= Date: Thu, 21 Nov 2024 13:44:40 +0100 Subject: [PATCH] Fix incorrect path normalization in coqdep on `//..` `x/y//..` would get normalized to `x/y` instead of `x` Fix #19862 --- tools/coqdep/lib/file_util.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/coqdep/lib/file_util.ml b/tools/coqdep/lib/file_util.ml index 4ca9a62f88ea..3cb97807b43f 100644 --- a/tools/coqdep/lib/file_util.ml +++ b/tools/coqdep/lib/file_util.ml @@ -23,7 +23,7 @@ let to_relative_path : string -> string = fun full_path -> List.fold_left add_parent path cwd let normalize_path : string -> string = fun path -> - let re_delim = if Sys.win32 then "[/\\]" else "/" 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