Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/lib/uTop_main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ let init_history () =
return ()
| Some fn ->
Lwt.catch
(fun () -> LTerm_history.load UTop.history fn)
(fun () ->
let dn = Filename.dirname fn in
if not (Sys.file_exists dn) then Unix.mkdir dn 0o700;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't 700 a bit strict for permissions on a directory? I would expect 755 (possibly lowered by the user umask)

LTerm_history.load UTop.history fn)
(function
| Unix.Unix_error (error, func, arg) ->
Logs_lwt.err (fun m -> m "cannot load history from %S: %s: %s"
Expand Down
4 changes: 2 additions & 2 deletions src/lib/uTop_private.ml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ module Default_paths = struct
let history_file_name =
resolve
~legacy:(LTerm_resources.home / ".utop-history")
~filename:(Xdg.state_dir xdg / "utop-history")
~filename:(Xdg.state_dir xdg / "utop" / "utop-history")

let config_file_name =
resolve
~legacy:(LTerm_resources.home / ".utoprc")
~filename:(Xdg.config_dir xdg / "utoprc")
~filename:(Xdg.config_dir xdg / "utop" / "utoprc")
end

let size, set_size =
Expand Down