From 32448b138b32413ca8b8c1940822744866218264 Mon Sep 17 00:00:00 2001 From: Martin Hebnes Pedersen Date: Sun, 12 Jan 2025 21:30:15 +0100 Subject: [PATCH] Strip whitespace from Standard Forms version str Version 1.1.6.0 was released as `1.1.6\t.0`. --- internal/forms/forms.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/internal/forms/forms.go b/internal/forms/forms.go index 93cd167..594280c 100644 --- a/internal/forms/forms.go +++ b/internal/forms/forms.go @@ -24,6 +24,7 @@ import ( "strings" "sync" "time" + "unicode" "unicode/utf8" "github.com/la5nta/wl2k-go/fbb" @@ -574,7 +575,15 @@ func (m *Manager) getFormsVersion() string { debug.Printf("failed to open version file: %v", err) return "unknown" } - return strings.TrimSpace(str) + // Drop any whitespace in the string + // (version 1.1.6.0 was released as `1.1.6\t.0`). + str = strings.Map(func(r rune) rune { + if unicode.IsSpace(r) { + return -1 + } + return r + }, str) + return str } func (m *Manager) cleanupOldFormData() {