From 53ad870581f6f0a3ae16c323d76ea29e13f942f5 Mon Sep 17 00:00:00 2001 From: lucy phipps Date: Wed, 17 Jun 2020 12:40:42 +0100 Subject: [PATCH] escape the escape character --- src/common/platform/posix/sdl/i_system.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common/platform/posix/sdl/i_system.cpp b/src/common/platform/posix/sdl/i_system.cpp index df5ecd9a5..b3381efad 100644 --- a/src/common/platform/posix/sdl/i_system.cpp +++ b/src/common/platform/posix/sdl/i_system.cpp @@ -167,9 +167,9 @@ void I_PrintStr(const char *cp) else attrib = 0x15; } - printData.AppendFormat("%c[%um",0x1B,((attrib & 0x8) ? 90 : 30) + (attrib & 0x7)); + printData.AppendFormat("\033[%um",((attrib & 0x8) ? 90 : 30) + (attrib & 0x7)); } - else printData.AppendFormat("%c[38;2;%u;%u;%um",27,color.r,color.g,color.b); + else printData.AppendFormat("\033[38;2;%u;%u;%um",color.r,color.g,color.b); } } else if (*srcp != 0x1c && *srcp != 0x1d && *srcp != 0x1e && *srcp != 0x1f) @@ -183,8 +183,8 @@ void I_PrintStr(const char *cp) } } - fprintf(stdout,"%s",printData.GetChars()); - fprintf(stdout,"%c[0m",0x1B); + fputs(printData.GetChars(),stdout); + fputs("\033[0m",stdout); } int I_PickIWad (WadStuff *wads, int numwads, bool showwin, int defaultiwad)