diff options
author | Aaron Griffin <aaronmgriffin@gmail.com> | 2007-05-18 08:17:52 +0200 |
---|---|---|
committer | Aaron Griffin <aaronmgriffin@gmail.com> | 2007-05-18 08:17:52 +0200 |
commit | 9abe99f2369748004e64db5c499aa9be81dd3405 (patch) | |
tree | 5c689972837457f9951207859899476da1367cb1 /lib/libalpm | |
parent | 4e6b7c1cde4c0ac1d035b51f9af19510a7c9135e (diff) | |
download | pacman-9abe99f2369748004e64db5c499aa9be81dd3405.tar.gz pacman-9abe99f2369748004e64db5c499aa9be81dd3405.tar.xz |
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>
Diffstat (limited to 'lib/libalpm')
-rw-r--r-- | lib/libalpm/server.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/libalpm/server.c b/lib/libalpm/server.c index 1d972bdb..650c594a 100644 --- a/lib/libalpm/server.c +++ b/lib/libalpm/server.c @@ -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; |