Skip to content
Snippets Groups Projects
Commit 4e24ad12 authored by James R.'s avatar James R.
Browse files

Strip trailing slashes from masterserver address

parent c2ee6f3b
No related branches found
No related tags found
1 merge request!224Master Server 2
...@@ -499,6 +499,19 @@ HMS_compare_mod_version (char *buffer, size_t buffer_size) ...@@ -499,6 +499,19 @@ HMS_compare_mod_version (char *buffer, size_t buffer_size)
return ok; return ok;
} }
static char *
Strip_trailing_slashes (char *api)
{
char * p = &api[strlen(api)];
while (*--p == '/')
;
p[1] = '\0';
return api;
}
void void
HMS_set_api (char *api) HMS_set_api (char *api)
{ {
...@@ -507,7 +520,7 @@ HMS_set_api (char *api) ...@@ -507,7 +520,7 @@ HMS_set_api (char *api)
#endif #endif
{ {
free(hms_api); free(hms_api);
hms_api = api; hms_api = Strip_trailing_slashes(api);
} }
#ifdef HAVE_THREADS #ifdef HAVE_THREADS
I_unlock_mutex(hms_api_mutex); I_unlock_mutex(hms_api_mutex);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment