aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2019-08-06 09:56:38 +0200
committerPierre-Marie Pédrot2019-08-06 09:56:38 +0200
commit823fdc311e700ec2edb6441d5fc6908d58818dd5 (patch)
tree45b88f5c17781e28ecdce38b8ef9cbb6c0c01ed9
parente797e35d137d6cf84591335e60b3668f8f7e64b2 (diff)
parent64906d402e9757af850b9562aaae69099abf871f (diff)
Merge PR #10557: Fixing #10286 (coqide hangs on invalid filenames)
Ack-by: maximedenes Reviewed-by: ppedrot
-rw-r--r--ide/coqide.ml8
1 files changed, 7 insertions, 1 deletions
diff --git a/ide/coqide.ml b/ide/coqide.ml
index 00168a06b1..9cdfd0dc21 100644
--- a/ide/coqide.ml
+++ b/ide/coqide.ml
@@ -110,7 +110,13 @@ let make_coqtop_args fname =
| None -> args
| Some fname ->
if List.exists (String.equal "-top") args then args
- else "-topfile"::fname::args
+ else
+ (* We basically copy the code of Names.check_valid since it is not exported *)
+ (* to coqide. This is to prevent a possible failure of parsing "-topfile" *)
+ (* at initialization of coqtop (see #10286) *)
+ match Unicode.ident_refutation (Filename.chop_extension (Filename.basename fname)) with
+ | Some (_,x) -> output_string stderr (x^"\n"); exit 1
+ | None -> "-topfile"::fname::args
in
proj, args