summaryrefslogtreecommitdiffstats
path: root/otherlibs/labltk/browser/shell.ml
diff options
context:
space:
mode:
authorJacques Garrigue <garrigue at math.nagoya-u.ac.jp>2001-10-02 09:27:47 +0000
committerJacques Garrigue <garrigue at math.nagoya-u.ac.jp>2001-10-02 09:27:47 +0000
commit68fd0810dd91b139d97c68c5a523cb7020c33061 (patch)
tree08f8bbc0f5e9aacd5e8b79f9ebb3b5e77d715aeb /otherlibs/labltk/browser/shell.ml
parent13f0597ebcc3a0401d2b194ef6136196a948907a (diff)
message for program not found
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@3824 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'otherlibs/labltk/browser/shell.ml')
-rw-r--r--otherlibs/labltk/browser/shell.ml10
1 files changed, 9 insertions, 1 deletions
diff --git a/otherlibs/labltk/browser/shell.ml b/otherlibs/labltk/browser/shell.ml
index 2beab39ff..52fe68820 100644
--- a/otherlibs/labltk/browser/shell.ml
+++ b/otherlibs/labltk/browser/shell.ml
@@ -247,6 +247,12 @@ let path_sep = if Sys.os_type = "Win32" then ";" else ":"
let warnings = ref "A"
+let program_not_found prog =
+ ignore begin
+ Jg_message.ask ~cancel:false ~no:false ~title:"Error"
+ ("Program \"" ^ String.escaped prog ^ "\"\nwas not found in path")
+ end
+
let f ~prog ~title =
let progargs =
List.filter ~f:((<>) "") (Str.split ~!" " prog) in
@@ -255,11 +261,13 @@ let f ~prog ~title =
let path =
try Sys.getenv "PATH" with Not_found -> "/bin" ^ path_sep ^ "/usr/bin" in
let exec_path = Str.split ~!path_sep path in
+ let exec_path =
+ if Sys.os_type = "Win32" then "."::exec_path else exec_path in
let exists =
if not (Filename.is_implicit prog) then may_exec prog else
List.exists exec_path
~f:(fun dir -> may_exec (Filename.concat dir prog)) in
- if not exists then () else
+ if not exists then program_not_found prog else
let tl = Jg_toplevel.titled title in
let menus = Frame.create tl ~name:"menubar" in
let file_menu = new Jg_menu.c "File" ~parent:menus