Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
kit-ty-kate committed May 22, 2024
1 parent 69b4478 commit a85c695
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/core/opamSystem.ml
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,12 @@ let copy_file_aux ?chmod ~src ~dst () =
let list kind dir =
try
let d = Sys.readdir dir in
let d = Array.to_list d in
let l = List.filter kind d in
List.map (Filename.concat dir) (List.sort compare l)
let l = Array.fold_left (fun acc d ->
let d = dir / d in
if kind d then d :: acc else acc
) [] d
in
List.sort String.compare l
with File_not_found _ -> []
let ls dir = list (fun _ -> true) dir
Expand Down

0 comments on commit a85c695

Please sign in to comment.