mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
- fix handling of highbit whitespace in names, as well as stripping
all highbits from names
This commit is contained in:
parent
2bbb759232
commit
388c3a78ee
1 changed files with 3 additions and 2 deletions
|
@ -2163,6 +2163,7 @@ Master_Shutdown (void)
|
||||||
static inline qboolean
|
static inline qboolean
|
||||||
iswhitespace (char c)
|
iswhitespace (char c)
|
||||||
{
|
{
|
||||||
|
c &= 127;
|
||||||
return c == ' ' || c == '\r' || c == '\n' || c == '\t';
|
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++) {
|
for (r = newname; *p && r != newname + sizeof (newname) - 1; p++) {
|
||||||
if (iswhitespace (*p)) {
|
if (iswhitespace (*p)) {
|
||||||
if (!iswhitespace (p[1]) && p[1] != '\0')
|
if (!iswhitespace (p[1]) && p[1] != '\0')
|
||||||
*r++ = *p;
|
*r++ = ' '; // get rid of any special chars
|
||||||
} else
|
} else
|
||||||
*r++ = *p;
|
*r++ = *p & 127; // get rid of bold
|
||||||
}
|
}
|
||||||
*r = '\0';
|
*r = '\0';
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue