From 251228d677b26c51eb0d756f5da86458e6c85f6e Mon Sep 17 00:00:00 2001 From: Haz Date: Mon, 21 Sep 2020 22:23:36 +0000 Subject: [PATCH 1/2] Make sure we're not at $HOME before sourcing local .ocamlinit (fixes: Github #333) --- src/lib/uTop_main.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/uTop_main.ml b/src/lib/uTop_main.ml index 3c6e83c..6aa361b 100644 --- a/src/lib/uTop_main.ml +++ b/src/lib/uTop_main.ml @@ -1479,7 +1479,7 @@ let common_init ~initial_env = None ) | None -> - if Sys.file_exists ".ocamlinit" then + if Sys.file_exists ".ocamlinit" && Sys.getcwd () <> Sys.getenv "HOME" then Some ".ocamlinit" else let xdg_fn = LTerm_resources.xdgbd_file ~loc:LTerm_resources.Config "utop/init.ml" in From ee030bab0b7ae6f65e27e3853904c86b623d186d Mon Sep 17 00:00:00 2001 From: Haz Date: Wed, 31 Mar 2021 09:47:39 +0200 Subject: [PATCH 2/2] Use lambdaterm resources for home path instead of sys Co-authored-by: Fabian --- src/lib/uTop_main.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/uTop_main.ml b/src/lib/uTop_main.ml index 6aa361b..63e46f9 100644 --- a/src/lib/uTop_main.ml +++ b/src/lib/uTop_main.ml @@ -1479,7 +1479,7 @@ let common_init ~initial_env = None ) | None -> - if Sys.file_exists ".ocamlinit" && Sys.getcwd () <> Sys.getenv "HOME" then + if Sys.file_exists ".ocamlinit" && Sys.getcwd () <> LTerm_resources.home then Some ".ocamlinit" else let xdg_fn = LTerm_resources.xdgbd_file ~loc:LTerm_resources.Config "utop/init.ml" in