Skip to content

Commit

Permalink
fix fileExtension()
Browse files Browse the repository at this point in the history
  • Loading branch information
mmews committed Jan 22, 2024
1 parent ea88915 commit a30d4bf
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,17 @@ static private int fileExtensionIndex(URI uri) {
if (firstIdx < 0) {
return -1;
}
boolean foundDot = false;
for (int idx = firstIdx; idx > 0; idx--) {
if (lastSegment.charAt(idx) == '.') {
foundDot = true;
firstIdx = idx + 1;
break;
}
}
if (!foundDot) {
return -1;
}
String ext1 = lastSegment.substring(firstIdx);
if (extensionPrefixes.containsKey(ext1)) {
int scndIdx = firstIdx - 2;
Expand Down

0 comments on commit a30d4bf

Please sign in to comment.