projects
/
petitboot
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bf40f5f
)
ui/common/url: Fix multiple-preceeding-slash on pathnames
author
Jeremy Kerr
<jk@ozlabs.org>
Wed, 6 Mar 2013 05:42:15 +0000
(13:42 +0800)
committer
Geoff Levand
<geoff@infradead.org>
Wed, 6 Mar 2013 14:06:49 +0000
(06:06 -0800)
Fix the double-slash URL test.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Geoff Levand <geoff@infradead.org>
ui/common/url.c
patch
|
blob
|
history
diff --git
a/ui/common/url.c
b/ui/common/url.c
index 3e6c8dacc19816df8b45ce158bac948a0d214fc0..4e4b9610cd96f1016a6d38aca78e258f5a97452c 100644
(file)
--- 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);
}