mirror of
https://github.com/pissnet/pissircd.git
synced 2025-07-30 23:12:25 +01:00
Fix +S stripping too much on incorrect color codes.
Reported by semioriginal in https://bugs.unrealircd.org/view.php?id=5908 with the patch also by semioriginal.
This commit is contained in:
parent
5cdcb95cdf
commit
3bccc63125
2 changed files with 7 additions and 2 deletions
|
@ -2595,7 +2595,8 @@ const char *StripControlCodesEx(const char *text, char *output, size_t outputlen
|
|||
|
||||
while (len > 0)
|
||||
{
|
||||
if ( col && ((isdigit(*text) && nc < 2) || (*text == ',' && nc < 3)))
|
||||
if ((col && isdigit(*text) && nc < 2) ||
|
||||
((col == 1) && (*text == ',') && isdigit(text[1]) && (nc > 0) && (nc < 3)))
|
||||
{
|
||||
nc++;
|
||||
if (*text == ',')
|
||||
|
|
|
@ -537,11 +537,15 @@ const char *_StripColors(const char *text)
|
|||
|
||||
while (len > 0)
|
||||
{
|
||||
if ((col && isdigit(*text) && nc < 2) || (col && *text == ',' && nc < 3))
|
||||
if ((col && isdigit(*text) && nc < 2) ||
|
||||
((col == 1) && (*text == ',') && isdigit(text[1]) && (nc > 0) && (nc < 3)))
|
||||
{
|
||||
nc++;
|
||||
if (*text == ',')
|
||||
{
|
||||
nc = 0;
|
||||
col++;
|
||||
}
|
||||
}
|
||||
/* Syntax for RGB is ^DHHHHHH where H is a hex digit.
|
||||
* If < 6 hex digits are specified, the code is displayed
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue