Skip to content

Commit

Permalink
Fix --include path filtering.
Browse files Browse the repository at this point in the history
  • Loading branch information
anmaped committed Oct 23, 2024
1 parent 55b9b6f commit 3f6a515
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/rmtld3synth.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3f6a515

Please sign in to comment.