From 08c751a33d9444cf0403185d5d491ed52e63a03b Mon Sep 17 00:00:00 2001 From: Indev Date: Fri, 24 Oct 2025 16:36:07 +0300 Subject: [PATCH] Skip repeating backslashes in HU_DoCEcho when printing to console --- src/hu_stuff.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 3dc26af3a..093003e18 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -2856,8 +2856,20 @@ void HU_DoCEcho(const char *msg) strncpy(temp, cechotext, sizeof(temp)); for (char *p = temp; *p != '\0'; ++p) + { if (*p == '\\') + { *p = '\n'; + ++p; + char *skip_p = p; // Point at which we will move part of string after all \'s + + while (*p == '\\') + ++p; + + memmove(skip_p, p, strlen(p)+1); // move the rest of string with null byte + p = skip_p; // Restore p + } + } CONS_Printf("%s\n", temp);