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:
Aaron Griffin 2007-05-18 01:17:52 -05:00
parent 4e6b7c1cde
commit 9abe99f236

View file

@ -71,6 +71,10 @@ pmserver_t *_alpm_server_new(const char *url)
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;
return server;