mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-26 20:31:30 +00:00
Strip trailing slashes from masterserver address
This commit is contained in:
parent
c2ee6f3b95
commit
4e24ad125c
1 changed files with 14 additions and 1 deletions
|
@ -499,6 +499,19 @@ HMS_compare_mod_version (char *buffer, size_t buffer_size)
|
|||
return ok;
|
||||
}
|
||||
|
||||
static char *
|
||||
Strip_trailing_slashes (char *api)
|
||||
{
|
||||
char * p = &api[strlen(api)];
|
||||
|
||||
while (*--p == '/')
|
||||
;
|
||||
|
||||
p[1] = '\0';
|
||||
|
||||
return api;
|
||||
}
|
||||
|
||||
void
|
||||
HMS_set_api (char *api)
|
||||
{
|
||||
|
@ -507,7 +520,7 @@ HMS_set_api (char *api)
|
|||
#endif
|
||||
{
|
||||
free(hms_api);
|
||||
hms_api = api;
|
||||
hms_api = Strip_trailing_slashes(api);
|
||||
}
|
||||
#ifdef HAVE_THREADS
|
||||
I_unlock_mutex(hms_api_mutex);
|
||||
|
|
Loading…
Reference in a new issue