Clarify .exe suffix handling in class normalization

This commit is contained in:
2026-06-02 12:21:12 -04:00
parent 4ea8aed04b
commit f79c149039
2 changed files with 4 additions and 2 deletions
+3 -2
View File
@@ -14,8 +14,9 @@ func ClassFromImagePath(p string) string {
if i := strings.LastIndexAny(p, `\/`); i >= 0 {
p = p[i+1:]
}
if len(p) >= 4 && strings.EqualFold(p[len(p)-4:], ".exe") {
p = p[:len(p)-4]
const exeSuffix = ".exe"
if len(p) >= len(exeSuffix) && strings.EqualFold(p[len(p)-len(exeSuffix):], exeSuffix) {
p = p[:len(p)-len(exeSuffix)]
}
return strings.ToLower(p)
}