- Applied VoidMage's patch to strip color codes from system console on SDL platforms.

This commit is contained in:
Braden Obrzut 2013-11-06 13:42:05 -05:00
parent f0b946c3cf
commit 34457ce737
1 changed files with 21 additions and 1 deletions

View File

@ -422,7 +422,27 @@ void I_SetIWADInfo ()
void I_PrintStr (const char *cp) void I_PrintStr (const char *cp)
{ {
fputs (cp, stdout); // Strip out any color escape sequences before writing to the log file
char * copy = new char[strlen(cp)+1];
const char * srcp = cp;
char * dstp = copy;
while (*srcp != 0)
{
if (*srcp!=0x1c && *srcp!=0x1d && *srcp!=0x1e && *srcp!=0x1f)
{
*dstp++=*srcp++;
}
else
{
if (srcp[1]!=0) srcp+=2;
else break;
}
}
*dstp=0;
fputs (copy, stdout);
delete [] copy;
fflush (stdout); fflush (stdout);
} }