mirror of
https://github.com/moparisthebest/pacman
synced 2025-03-04 11:19:46 -05:00
minor: Remove trailing slashes from Server urls to prevent double slashes in
paths
This commit is contained in:
parent
337046ab75
commit
48c840fb76
@ -72,6 +72,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;
|
||||||
@ -126,6 +130,7 @@ static struct url *url_for_file(pmserver_t *server, const char *filename)
|
|||||||
}
|
}
|
||||||
|
|
||||||
snprintf(doc, doclen, "%s/%s", server->s_url->doc, filename);
|
snprintf(doc, doclen, "%s/%s", server->s_url->doc, filename);
|
||||||
|
_alpm_log(PM_LOG_DEBUG, "file path: '%s'", doc);
|
||||||
ret = downloadMakeURL(server->s_url->scheme,
|
ret = downloadMakeURL(server->s_url->scheme,
|
||||||
server->s_url->host,
|
server->s_url->host,
|
||||||
server->s_url->port,
|
server->s_url->port,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user