Skip to content

Commit

Permalink
Fix OpamStd.Sys.etc on Windows
Browse files Browse the repository at this point in the history
Returns %ProgramData%\opam now
  • Loading branch information
dra27 committed Jun 2, 2024
1 parent 0221943 commit 61c94b7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/core/opamStd.ml
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,14 @@ module OpamSys = struct
) in
fun () -> Lazy.force home

let etc () = "/etc"
let etc =
if Sys.win32 then
fun () ->
(* CSIDL_COMMON_APPDATA = 0x23 *)
let root = OpamStubs.(shGetFolderPath 0x23 SHGFP_TYPE_CURRENT) in
Filename.concat root "opam"
else
fun () -> "/etc"

let uname =
let memo = Hashtbl.create 7 in
Expand Down

0 comments on commit 61c94b7

Please sign in to comment.