From b6a6c19d0fb138a14bbcb73f3f104c4c885dc2d2 Mon Sep 17 00:00:00 2001 From: Jeremy Kerr Date: Wed, 6 Mar 2013 13:42:15 +0800 Subject: ui/common/url: Fix multiple-preceeding-slash on pathnames Fix the double-slash URL test. Signed-off-by: Jeremy Kerr Signed-off-by: Geoff Levand --- ui/common/url.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ui/common') diff --git a/ui/common/url.c b/ui/common/url.c index 3e6c8da..4e4b961 100644 --- a/ui/common/url.c +++ b/ui/common/url.c @@ -170,6 +170,11 @@ struct pb_url *pb_url_parse(void *ctx, const char *url_str) url->port = NULL; url->host = talloc_strndup(url, p, path - p); } + + /* remove multiple leading slashes */ + for (; *path && *(path+1) == '/'; path++) + ; + url->path = talloc_strdup(url, path); } -- cgit v1.2.1