aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorGravatar herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7>2008-05-08 17:12:52 +0000
committerGravatar herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7>2008-05-08 17:12:52 +0000
commit5be44b3892fe9a7852fa4194ed758baa63474791 (patch)
treeaaf8431811fe414248fbccbf7cba1cc8430ae57f /lib
parente8afb1ffb51bc158b6c90578be70581d364681de (diff)
Suite 10904 (fichiers oubliés)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@10905 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'lib')
-rw-r--r--lib/flags.ml25
-rw-r--r--lib/flags.mli7
2 files changed, 16 insertions, 16 deletions
diff --git a/lib/flags.ml b/lib/flags.ml
index 6a801480a..60d6c7836 100644
--- a/lib/flags.ml
+++ b/lib/flags.ml
@@ -6,7 +6,7 @@
(* * GNU Lesser General Public License Version 2.1 *)
(************************************************************************)
-(*i $Id:$ i*)
+(*i $Id$ i*)
open Util
@@ -108,21 +108,20 @@ let boxed_definitions _ = !boxed_definitions
(* Flags.for external tools *)
+let subst_command_placeholder s t =
+ let buff = Buffer.create (String.length s + String.length t) in
+ for i = 0 to String.length s - 2 do
+ if s.[i] = '%' & s.[i+1] = 's' then Buffer.add_string buff t
+ else Buffer.add_char buff s.[i]
+ done;
+ Buffer.contents buff
+
let browser_cmd_fmt =
try
let coq_netscape_remote_var = "COQREMOTEBROWSER" in
- let coq_netscape_remote = Sys.getenv coq_netscape_remote_var in
- let i = Util.string_index_from coq_netscape_remote 0 "%s" in
- let pre = String.sub coq_netscape_remote 0 i in
- let post = String.sub coq_netscape_remote (i + 2)
- (String.length coq_netscape_remote - (i + 2)) in
- if Util.string_string_contains ~where:post ~what:"%s" then
- error ("The environment variable \"" ^
- coq_netscape_remote_var ^
- "\" must contain exactly one placeholder \"%s\".")
- else pre,post
+ Sys.getenv coq_netscape_remote_var
with
Not_found ->
if Sys.os_type = "Win32"
- then "C:\\PROGRA~1\\INTERN~1\\IEXPLORE ", ""
- else "firefox -remote \"OpenURL(", ")\""
+ then "C:\\PROGRA~1\\INTERN~1\\IEXPLORE %s"
+ else "firefox -remote \"OpenURL(%s,new-tab)\" || firefox %s"
diff --git a/lib/flags.mli b/lib/flags.mli
index 73962735d..c14e223e7 100644
--- a/lib/flags.mli
+++ b/lib/flags.mli
@@ -68,7 +68,8 @@ val boxed_definitions : unit -> bool
(* Options for external tools *)
-(* Returns head and tail of printf string format *)
-(* ocaml doesn't allow not applied formats *)
-val browser_cmd_fmt : string * string
+(* Returns string format for default browser to use from Coq or CoqIDE *)
+val browser_cmd_fmt : string
+(* Substitute %s in the first chain by the second chain *)
+val subst_command_placeholder : string -> string -> string