Skip to content

Commit

Permalink
Fix include-path management regarding duplicate paths
Browse files Browse the repository at this point in the history
The duplicate path check now accounts for the associated namespace,
allowing the same path to be added to multiple different namespaces.
  • Loading branch information
strub committed Dec 10, 2024
1 parent 9eaff01 commit 93e0545
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ecLoader.ml
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,16 @@ let rec addidir ?namespace ?(recursive = false) (idir : string) (ecl : ecloader)
| None -> ()
| Some st -> begin
let idx = (st.Unix.st_dev, st.Unix.st_ino) in
let idirs = List.filter (fun ((nm, _), _) -> nm = namespace) ecl.ecl_idirs in

match Sys.os_type with
| "Win32" ->
let test ((_, name), _) = name = idir in
if not (List.exists test ecl.ecl_idirs) then
if not (List.exists test idirs) then
ecl.ecl_idirs <- ((namespace, idir), idx) :: ecl.ecl_idirs

| _ ->
if not (List.exists ((=) idx |- snd) ecl.ecl_idirs) then
if not (List.exists ((=) idx |- snd) idirs) then
ecl.ecl_idirs <- ((namespace, idir), idx) :: ecl.ecl_idirs
end

Expand Down

0 comments on commit 93e0545

Please sign in to comment.