Skip to content

Commit aaaa821

Browse files
committed
removed leading slash in windows path #25
1 parent 52c5996 commit aaaa821

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/main/java/ch/bildspur/postfx/pass/BasePass.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,17 @@ private String getLibPath() {
5151
int n1 = -1;
5252

5353
// read jar file name
54-
String jar = Paths.get(BasePass.class.getProtectionDomain()
54+
String fullJarPath = BasePass.class.getProtectionDomain()
5555
.getCodeSource()
5656
.getLocation()
57-
.getPath()).getFileName().toString();
57+
.getPath();
58+
59+
if (PApplet.platform == PConstants.WINDOWS) {
60+
// remove leading /
61+
fullJarPath = fullJarPath.substring(1);
62+
}
63+
64+
String jar = Paths.get(fullJarPath).getFileName().toString();
5865

5966
n1 = path.indexOf(jar);
6067
if (PApplet.platform == PConstants.WINDOWS) { //platform Windows

0 commit comments

Comments
 (0)