From 8330c0b1da55a29d0b23dc452f4749be52cc3e8e Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Tue, 10 Oct 2017 16:21:00 +0200 Subject: Fix BZ#5780: coq_makefile broken under Cygwin --- tools/coq_makefile.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/coq_makefile.ml b/tools/coq_makefile.ml index 4a9d871fd3..2feaaa04cd 100644 --- a/tools/coq_makefile.ml +++ b/tools/coq_makefile.ml @@ -122,7 +122,8 @@ let generate_makefile oc conf_file local_file args project = Envars.coqlib () ^ template in let s = read_whole_file makefile_template in let s = List.fold_left - (fun s (k,v) -> Str.global_replace (Str.regexp_string k) v s) s + (* We use global_substitute to avoid running into backslash issues due to \1 etc. *) + (fun s (k,v) -> Str.global_substitute (Str.regexp_string k) (fun _ -> v) s) s [ "@CONF_FILE@", conf_file; "@LOCAL_FILE@", local_file; "@COQ_VERSION@", Coq_config.version; -- cgit v1.2.3