if (start[l] == '\n' || !start[l])
break;
// color codes add no visible characters, so don't count them
- if (start[l] == '^' && (start[l+1] >= '0' && start[l+1] <= '9'))
+ if (start[l] == STRING_COLOR_TAG && (start[l+1] >= '0' && start[l+1] <= '9'))
l++;
else
chars++;
if(!Cmd_Exists(PRVM_G_STRING(OFS_PARM0)))
{
size_t alloclen;
-
+
alloclen = strlen(PRVM_G_STRING(OFS_PARM0)) + 1;
t = (char *)Z_Malloc(alloclen);
memcpy(t, PRVM_G_STRING(OFS_PARM0), alloclen);
char c2 = c - (c & 128);
char t2 = t - (t & 128);
- if(c != '^' && c2 != '^') return 0;
+ if(c != STRING_COLOR_TAG && c2 != STRING_COLOR_TAG) return 0;
if(t >= '0' && t <= '9') a = 1;
if(t2 >= '0' && t2 <= '9') a = 1;
/* if(t >= 'A' && t <= 'Z') a = 2;
{
switch(*in)
{
- case '^':
+ case STRING_COLOR_TAG:
switch(in[1])
{
- case '^':
+ case STRING_COLOR_TAG:
++in;
- *out++ = '^';
+ *out++ = STRING_COLOR_TAG;
break;
case '0':
case '7':
*out++ = 0x1B; *out++ = '['; *out++ = '0'; *out++ = ';'; *out++ = '1'; *out++ = 'm';
break;
default:
- *out++ = '^';
+ *out++ = STRING_COLOR_TAG;
break;
}
break;
{
switch(*in)
{
- case '^':
+ case STRING_COLOR_TAG:
switch(in[1])
{
- case '^':
+ case STRING_COLOR_TAG:
++in;
- *out++ = '^';
+ *out++ = STRING_COLOR_TAG;
break;
case '0':
case '1':
++in;
break;
default:
- *out++ = '^';
+ *out++ = STRING_COLOR_TAG;
break;
}
break;
// count up to the last non-whitespace, and ignore color codes
for (j = 0;j < con_linewidth && text[j];j++)
{
- if (text[j] == '^' && (text[j+1] >= '0' && text[j+1] <= '9'))
+ if (text[j] == STRING_COLOR_TAG && (text[j+1] >= '0' && text[j+1] <= '9'))
{
j++;
continue;