summaryrefslogtreecommitdiffstats
path: root/ui/common
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2013-03-06 13:42:15 +0800
committerGeoff Levand <geoff@infradead.org>2013-03-06 06:06:49 -0800
commitb6a6c19d0fb138a14bbcb73f3f104c4c885dc2d2 (patch)
treeacfb1559aaeb7e3b9ff68d693b58918c835696eb /ui/common
parentbf40f5fbd759241d1505c985fa02441cd6febd64 (diff)
downloadtalos-petitboot-b6a6c19d0fb138a14bbcb73f3f104c4c885dc2d2.tar.gz
talos-petitboot-b6a6c19d0fb138a14bbcb73f3f104c4c885dc2d2.zip
ui/common/url: Fix multiple-preceeding-slash on pathnames
Fix the double-slash URL test. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Geoff Levand <geoff@infradead.org>
Diffstat (limited to 'ui/common')
-rw-r--r--ui/common/url.c5
1 files changed, 5 insertions, 0 deletions
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);
}
OpenPOWER on IntegriCloud