From a5488e200591279d3155de9d0891173a199d2a89 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gustaf=20Alh=C3=A4ll?= <gustaf@hanicef.me>
Date: Sun, 1 Dec 2024 15:59:19 +0100
Subject: [PATCH] Fix connecting to localhost on non-standard ports

---
 src/netcode/d_net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/netcode/d_net.c b/src/netcode/d_net.c
index 99859ea4c0..4860d8688b 100644
--- a/src/netcode/d_net.c
+++ b/src/netcode/d_net.c
@@ -1143,7 +1143,7 @@ static void Internal_FreeNodenum(INT32 nodenum)
 
 char *I_NetSplitAddress(char *host, char **port)
 {
-	boolean v4 = (strchr(host, '.') != NULL);
+	boolean v4 = (host[0] != '[');
 
 	host = strtok(host, v4 ? ":" : "[]");
 
-- 
GitLab