Skip to content

Commit 18aec22

Browse files
committed
* Fix Loader.createLibraryLink() incorrectly truncating library versions when there is one before and another after the suffix
1 parent 5e7ff25 commit 18aec22

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11

2+
* Fix `Loader.createLibraryLink()` incorrectly truncating library versions when there is one before and another after the suffix
23
* Iterate extensions of libraries or executables on `Loader.load()` in reverse to be consistent with properties overriding
34
* Allow prefixing library names with `:` to have `Loader` consider them as filenames with prefix and suffix already included
45
* Add `Loader.loadGlobal()` to load symbols globally as often required by Python libraries ([issue ContinuumIO/anaconda-issues#6401](https://github.com/ContinuumIO/anaconda-issues/issues/6401))

src/main/java/org/bytedeco/javacpp/Loader.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1440,7 +1440,11 @@ public static String createLibraryLink(String filename, ClassProperties properti
14401440
int n = name.lastIndexOf(suffix);
14411441
int n2 = version.length() != 0 ? name.lastIndexOf(version)
14421442
: name.indexOf(".");
1443-
if (n > 0 && n2 > 0) {
1443+
int n3 = name.lastIndexOf(".");
1444+
if (n2 < n && n < n3) {
1445+
link = name.substring(0, n) + suffix;
1446+
break;
1447+
} else if (n > 0 && n2 > 0) {
14441448
link = name.substring(0, n < n2 ? n : n2) + suffix;
14451449
break;
14461450
}

0 commit comments

Comments
 (0)