summaryrefslogtreecommitdiff
path: root/content/urldb.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-11-22 23:25:18 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-11-22 23:25:18 +0000
commitd591d8df94f7e7ff73f6367e79c912b8f9ed75f9 (patch)
treee7f21ad9e391f7c87e4f36b2d4723891e3ccb1c7 /content/urldb.c
parentea288ade79e56722557530924b6de7d11d496e5a (diff)
downloadnetsurf-d591d8df94f7e7ff73f6367e79c912b8f9ed75f9.tar.gz
netsurf-d591d8df94f7e7ff73f6367e79c912b8f9ed75f9.tar.bz2
Treat decomposed URLs with no path component as being for the path "/".
svn path=/trunk/netsurf/; revision=9703
Diffstat (limited to 'content/urldb.c')
-rw-r--r--content/urldb.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/content/urldb.c b/content/urldb.c
index 50c15810d..a3a75799a 100644
--- a/content/urldb.c
+++ b/content/urldb.c
@@ -1915,6 +1915,9 @@ struct path_data *urldb_find_url(const char *url)
/* generate plq */
if (components.path)
len += strlen(components.path);
+ else
+ len += SLEN("/");
+
if (components.query)
len += strlen(components.query) + 1;
@@ -1931,7 +1934,11 @@ struct path_data *urldb_find_url(const char *url)
if (components.path) {
strcpy(copy, components.path);
copy += strlen(components.path);
+ } else {
+ strcpy(copy, "/");
+ copy += SLEN("/");
}
+
if (components.query) {
*copy++ = '?';
strcpy(copy, components.query);