Remove trailing slashes from Server URLs
Simple clean up for the rest of the code, which also prevents a little libdownload bug relating to '//' appearing in URLs. Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
This commit is contained in:
parent
4e6b7c1cde
commit
9abe99f236
1 changed files with 4 additions and 0 deletions
|
@ -71,6 +71,10 @@ pmserver_t *_alpm_server_new(const char *url)
|
||||||
strcpy(u->pwd, "libalpm@guest");
|
strcpy(u->pwd, "libalpm@guest");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* remove trailing slashes, just to clean up the rest of the code */
|
||||||
|
for(int i = strlen(u->doc) - 1; u->doc[i] == '/'; --i)
|
||||||
|
u->doc[i] = '\0';
|
||||||
|
|
||||||
server->s_url = u;
|
server->s_url = u;
|
||||||
|
|
||||||
return server;
|
return server;
|
||||||
|
|
Loading…
Add table
Reference in a new issue