mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 14:51:51 +00:00
- Applied VoidMage's patch to strip color codes from system console on SDL platforms.
This commit is contained in:
parent
f0b946c3cf
commit
34457ce737
1 changed files with 21 additions and 1 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue