diff options
author | Aaron Griffin <aaron@archlinux.org> | 2007-05-08 10:11:59 +0200 |
---|---|---|
committer | Aaron Griffin <aaron@archlinux.org> | 2007-05-08 10:11:59 +0200 |
commit | 48c840fb76609046f1ecc1f3a2c83d288563e541 (patch) | |
tree | 500dda03cbca0e2215d76ab38563bf70bd360d05 /lib/libalpm/server.c | |
parent | 337046ab7550dccfe2bb73abe7cda28000550133 (diff) | |
download | pacman-48c840fb76609046f1ecc1f3a2c83d288563e541.tar.gz pacman-48c840fb76609046f1ecc1f3a2c83d288563e541.tar.xz |
minor: Remove trailing slashes from Server urls to prevent double slashes in
paths
Diffstat (limited to 'lib/libalpm/server.c')
-rw-r--r-- | lib/libalpm/server.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/libalpm/server.c b/lib/libalpm/server.c index 519c5084..b8635629 100644 --- a/lib/libalpm/server.c +++ b/lib/libalpm/server.c @@ -72,6 +72,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; @@ -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); + _alpm_log(PM_LOG_DEBUG, "file path: '%s'", doc); ret = downloadMakeURL(server->s_url->scheme, server->s_url->host, server->s_url->port, |