Skip to content

Commit

Permalink
Fix Resources.file for linux/windows
Browse files Browse the repository at this point in the history
  • Loading branch information
jjlauer committed Oct 1, 2024
1 parent 1b2379c commit a0c76b6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crux-util/src/main/java/com/fizzed/crux/util/Resources.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ static public void file(String resourceName, BiConsumer<Boolean,Path> consumer)
// we'll skip the file: part too
String jarPath = jarPathAndInnerFile.substring(5, sepPos);
// on windows, there's an extra / before the drive name
if (jarPath.charAt(0) == '/' && jarPath.indexOf(':') <= 5) {
int colonPos = jarPath.indexOf(':');
if (jarPath.charAt(0) == '/' && colonPos > 0 && colonPos <= 5) {
// we'll chop off the leading / char
jarPath = jarPath.substring(1);
}
Expand Down

0 comments on commit a0c76b6

Please sign in to comment.