diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/coqdoc/cdglobals.ml | 8 | ||||
-rw-r--r-- | tools/coqdoc/main.ml | 3 |
2 files changed, 8 insertions, 3 deletions
diff --git a/tools/coqdoc/cdglobals.ml b/tools/coqdoc/cdglobals.ml index 8a774876d..c9620a6f1 100644 --- a/tools/coqdoc/cdglobals.ml +++ b/tools/coqdoc/cdglobals.ml @@ -26,9 +26,15 @@ let out_to = ref MultFiles let out_channel = ref stdout let open_out_file f = - let f = if !output_dir <> "" then Filename.concat !output_dir f else f in + prerr_string f; prerr_newline(); + let f = if !output_dir <> "" && Filename.is_relative f then Filename.concat !output_dir f else f in out_channel := open_out f +let open_temp_out_file prefix suffix = + let tmp_fname, tmp_ochan = Filename.open_temp_file prefix suffix in + out_channel := tmp_ochan; + tmp_fname + let close_out_file () = close_out !out_channel diff --git a/tools/coqdoc/main.ml b/tools/coqdoc/main.ml index 90b15b64d..e02d7c7dc 100644 --- a/tools/coqdoc/main.ml +++ b/tools/coqdoc/main.ml @@ -449,9 +449,8 @@ let produce_output fl = if not (!dvi || !ps) then begin produce_document fl end else begin - let texfile = temp_file "coqdoc" ".tex" in + let texfile = open_temp_out_file "coqdoc" ".tex" in let basefile = chop_suffix texfile ".tex" in - open_out_file texfile; produce_document fl; let command = let file = basename texfile in |