From 3f6a5151a54c5b5228a77ad698a674259c8b994c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Pedro?= Date: Wed, 23 Oct 2024 13:29:43 +0100 Subject: [PATCH] Fix --include path filtering. --- src/rmtld3synth.ml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/rmtld3synth.ml b/src/rmtld3synth.ml index 2455f60..e7fb68e 100644 --- a/src/rmtld3synth.ml +++ b/src/rmtld3synth.ml @@ -61,8 +61,9 @@ let set_eval _ = set_setting "evaluate" (Sel true) helper let set_env v = let json = (* check whether this is a filename or a json string *) - let re = Str.regexp "^\\([.]?/[^/ ]*\\)+/?$" in - if Str.string_match re v 0 then + let re_path_unix = Str.regexp "^\\([.]?/[^/ ]*\\)+/?$" in + let re_path_windows = Str.regexp {|^[a-zA-Z]:\(\\[a-zA-Z0-9_\.-]+\)*\([\\]\|[\.][a-zA-Z]+\)?$|} in + if Str.string_match re_path_unix v 0 || Str.string_match re_path_windows v 0 then Yojson.Safe.from_file v else Yojson.Safe.from_string v