mirror of
https://github.com/SDL-Hercules-390/hyperion.git
synced 2026-04-20 18:57:06 +02:00
Remove "color" string from diag8 response and from logger processes after panel is shutdown.
git-svn-id: file:///home/jj/hercules.svn/trunk@6936 956126f8-22a0-4046-8f4a-272fa8102e63
This commit is contained in:
32
logger.c
32
logger.c
@@ -202,7 +202,37 @@ static void logger_term(void *arg)
|
||||
fwrite("\n",1,1,stderr);
|
||||
/* Read and display any msgs still remaining in the system log */
|
||||
while((lmscnt = log_read(&lmsbuf, &lmsnum, LOG_NOBLOCK)))
|
||||
fwrite(lmsbuf,lmscnt,1,stderr);
|
||||
{
|
||||
char *p = NULL;
|
||||
char *strtok_str = NULL;
|
||||
|
||||
lmsbuf[lmscnt-1] = '\0';
|
||||
|
||||
p = strtok_r( lmsbuf, "\n", &strtok_str );
|
||||
while ( (p = strtok_r(NULL, "\n", &strtok_str ) ) != NULL )
|
||||
{
|
||||
char* pLeft = p;
|
||||
int nLeft = (int)strlen(p);
|
||||
|
||||
#if defined( OPTION_MSGCLR )
|
||||
/* Remove "<pnl,..." color string if it exists */
|
||||
if (1
|
||||
&& nLeft > 5
|
||||
&& strncasecmp( pLeft, "<pnl", 4 ) == 0
|
||||
&& (pLeft = memchr( pLeft+4, '>', nLeft-4 )) != NULL
|
||||
)
|
||||
{
|
||||
pLeft++;
|
||||
nLeft -= (int)(pLeft - p);
|
||||
}
|
||||
#endif // defined( OPTION_MSGCLR )
|
||||
if (nLeft)
|
||||
{
|
||||
fwrite(pLeft,nLeft,1,stderr);
|
||||
fwrite("\n",1,1,stderr);
|
||||
}
|
||||
}
|
||||
}
|
||||
fflush(stderr);
|
||||
}
|
||||
}
|
||||
|
||||
21
logmsg.c
21
logmsg.c
@@ -459,7 +459,26 @@ DLL_EXPORT void log_write(int panel,char *msg)
|
||||
|
||||
if ( ptr != NULL ) free(ptr);
|
||||
|
||||
log_routes[slot].w(log_routes[slot].u,msg);
|
||||
/* strip color part of message */
|
||||
{
|
||||
char* pLeft = msg;
|
||||
int nLeft = (int)strlen(msg);
|
||||
#if defined( OPTION_MSGCLR )
|
||||
/* Remove "<pnl,..." color string if it exists */
|
||||
if ( 1
|
||||
&& nLeft > 5
|
||||
&& strncasecmp( pLeft, "<pnl", 4 ) == 0
|
||||
&& (pLeft = memchr( pLeft+4, '>', nLeft-4 )) != NULL
|
||||
)
|
||||
{
|
||||
pLeft++;
|
||||
nLeft -= (int)(pLeft - (char*)msg);
|
||||
}
|
||||
|
||||
#endif // defined( OPTION_MSGCLR )
|
||||
if (nLeft)
|
||||
log_routes[slot].w(log_routes[slot].u,pLeft);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user