Skip to content

Commit

Permalink
removed leading slash in windows path #25
Browse files Browse the repository at this point in the history
  • Loading branch information
cansik committed Jun 12, 2017
1 parent 52c5996 commit aaaa821
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/main/java/ch/bildspur/postfx/pass/BasePass.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,17 @@ private String getLibPath() {
int n1 = -1;

// read jar file name
String jar = Paths.get(BasePass.class.getProtectionDomain()
String fullJarPath = BasePass.class.getProtectionDomain()
.getCodeSource()
.getLocation()
.getPath()).getFileName().toString();
.getPath();

if (PApplet.platform == PConstants.WINDOWS) {
// remove leading /
fullJarPath = fullJarPath.substring(1);
}

String jar = Paths.get(fullJarPath).getFileName().toString();

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

0 comments on commit aaaa821

Please sign in to comment.