index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dave Reisner <dreisner@archlinux.org> | 2011-09-18 17:22:18 -0400 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-09-18 16:57:59 -0500 |
commit | 07e89c1e5db2769c1128f5d99fead151a4afc751 (patch) | |
tree | 342e1d531dc0bccf00c74b1de10ad727b0662189 /lib/libalpm/dload.c | |
parent | 52c65fdfea7d174ad2f4d895c5783d936fdac7d7 (diff) |
-rw-r--r-- | lib/libalpm/dload.c | 12 |
diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c index e786a3c0..6f0139d1 100644 --- a/lib/libalpm/dload.c +++ b/lib/libalpm/dload.c @@ -135,9 +135,15 @@ static int curl_gethost(const char *url, char *buffer) p += 2; /* jump over the found // */ hostlen = strcspn(p, "/"); - /* there might be a user:pass@ on the URL. hide it. */ - q = memrchr(p, '@', hostlen); - if(q) { + /* there might be a user:pass@ on the URL. hide it. avoid using memrchr() + * for portability concerns. */ + q = p + hostlen; + while(--q > p) { + if(*q == '@') { + break; + } + } + if(*q == '@' && p != q) { hostlen -= q - p + 1; p = q + 1; } |