# HG changeset patch # User reimar # Date 1164126398 0 # Node ID 4aff19cc00bbd78d7ceb817f1ce9e19173e76f47 # Parent 2e0938ba975650af3b278cd60b9d3133fb454a28 Also support absolute url redirection, e.g. http://www.youtube.com/v/buKaqRG2SFA (video does not play anyway though). diff -r 2e0938ba9756 -r 4aff19cc00bb stream/url.c --- a/stream/url.c Tue Nov 21 16:23:35 2006 +0000 +++ b/stream/url.c Tue Nov 21 16:26:38 2006 +0000 @@ -22,10 +22,15 @@ URL_t *url_redirect(URL_t **url, const char *redir) { URL_t *u = *url; URL_t *res; - if (!strchr(redir, '/')) { + if (!strchr(redir, '/') || *redir == '/') { char *tmp; char *newurl = malloc(strlen(u->url) + strlen(redir) + 1); strcpy(newurl, u->url); + if (*redir == '/') { + redir++; + tmp = strstr(newurl, "://"); + if (tmp) tmp = strchr(tmp + 3, '/'); + } else tmp = strrchr(newurl, '/'); if (tmp) tmp[1] = 0; strcat(newurl, redir);