- fix handling of highbit whitespace in names, as well as stripping

all highbits from names
This commit is contained in:
Adam Olsen 2001-10-31 02:18:09 +00:00
parent 2bbb759232
commit 388c3a78ee

View file

@ -2163,6 +2163,7 @@ Master_Shutdown (void)
static inline qboolean
iswhitespace (char c)
{
c &= 127;
return c == ' ' || c == '\r' || c == '\n' || c == '\t';
}
@ -2192,9 +2193,9 @@ SV_ExtractFromUserinfo (client_t *cl)
for (r = newname; *p && r != newname + sizeof (newname) - 1; p++) {
if (iswhitespace (*p)) {
if (!iswhitespace (p[1]) && p[1] != '\0')
*r++ = *p;
*r++ = ' '; // get rid of any special chars
} else
*r++ = *p;
*r++ = *p & 127; // get rid of bold
}
*r = '\0';