-// written by Elric, thanks Elric!
-char *SearchInfostring(const char *infostring, const char *key)
-{
- static char value [MAX_INPUTLINE];
- char crt_key [MAX_INPUTLINE];
- size_t value_ind, key_ind;
- char c;
-
- if (*infostring++ != '\\')
- return NULL;
-
- value_ind = 0;
- for (;;)
- {
- key_ind = 0;
-
- // Get the key name
- for (;;)
- {
- c = *infostring++;
-
- if (c == '\0')
- return NULL;
- if (c == '\\' || key_ind == sizeof (crt_key) - 1)
- {
- crt_key[key_ind] = '\0';
- break;
- }
-
- crt_key[key_ind++] = c;
- }
-
- // If it's the key we are looking for, save it in "value"
- if (!strcmp(crt_key, key))
- {
- for (;;)
- {
- c = *infostring++;
-
- if (c == '\0' || c == '\\' || value_ind == sizeof (value) - 1)
- {
- value[value_ind] = '\0';
- return value;
- }
-
- value[value_ind++] = c;
- }
- }
-
- // Else, skip the value
- for (;;)
- {
- c = *infostring++;
-
- if (c == '\0')
- return NULL;
- if (c == '\\')
- break;
- }
- }
-}
-
-void InfoString_GetValue(const char *buffer, const char *key, char *value, size_t valuelength)
+char *InfoString_GetValue(const char *buffer, const char *key, char *value, size_t valuelength)