mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-05-30 08:20:40 +00:00
forward port the client info string filtering from 0.3 and remove info.h from
a couple of c files that no longer need it.
This commit is contained in:
parent
8c026417d8
commit
74e9f89e8c
8 changed files with 63 additions and 18 deletions
|
@ -44,6 +44,24 @@
|
|||
|
||||
#include "compat.h"
|
||||
|
||||
/*
|
||||
Info_FilterForKey
|
||||
|
||||
Searches for key in the "client-needed" info string list
|
||||
*/
|
||||
qboolean
|
||||
Info_FilterForKey (const char *key, const char **filter_list)
|
||||
{
|
||||
const char **s;
|
||||
|
||||
for (s = filter_list; *s; s++) {
|
||||
if (strequal (*s, key)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Info_ValueForKey
|
||||
|
@ -138,7 +156,7 @@ Info_RemoveKey (char *s, const char *key)
|
|||
}
|
||||
|
||||
void
|
||||
Info_RemovePrefixedKeys (char *start, char prefix)
|
||||
Info_RemovePrefixedKeys (char *start, char prefix, const char **filter_list)
|
||||
{
|
||||
char *s;
|
||||
char pkey[512];
|
||||
|
@ -167,7 +185,8 @@ Info_RemovePrefixedKeys (char *start, char prefix)
|
|||
}
|
||||
*o = 0;
|
||||
|
||||
if (pkey[0] == prefix) {
|
||||
if (pkey[0] == prefix
|
||||
|| (filter_list && !Info_FilterForKey (pkey, filter_list))) {
|
||||
Info_RemoveKey (start, pkey);
|
||||
s = start;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue