Commit 281da180 authored by Johannes Kanig's avatar Johannes Kanig

O428-043 protect against absent plug-in dir

* why3config.ml
(plugins_auto) if plug-ins dir is absent, do not attempt to add plug-ins
parent 76fb6b30
...@@ -102,15 +102,19 @@ let plugins_auto_detection config = ...@@ -102,15 +102,19 @@ let plugins_auto_detection config =
let main = get_main config in let main = get_main config in
let main = set_plugins main [] in let main = set_plugins main [] in
let dir = Whyconf.pluginsdir main in let dir = Whyconf.pluginsdir main in
let files = Sys.readdir dir in let main =
let fold main p = if Sys.file_exists dir then
if p.[0] == '.' then main else let files = Sys.readdir dir in
let p = Filename.concat dir p in let fold main p =
try if p.[0] == '.' then main else
install_plugin main p let p = Filename.concat dir p in
with Exit -> main try
install_plugin main p
with Exit -> main
in
Array.fold_left fold main files
else main
in in
let main = Array.fold_left fold main files in
set_main config main set_main config main
let main () = let main () =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment