diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index bd4e50587..907597cbd 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -1347,6 +1347,14 @@ public class Base { try { String headers[] = headerListFromIncludePath(lib.getSrcFolder()); for (String header : headers) { + Library old = importToLibraryTable.get(header); + if (old != null) { + // If a library was already found with this header, keep + // it if the library's name matches the header name. + String name = header.substring(0, header.length() - 2); + if (old.getFolder().getPath().endsWith(name)) + continue; + } importToLibraryTable.put(header, lib); } } catch (IOException e) {