summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-12-18 22:01:58 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-12-18 22:01:58 +0200
commit21669124f2600376b8ec12d0710c56b1838bff0c (patch)
tree04e93d771ddd3dc059dec2f36ea9de8dcb349c6e
parent96d5db2560e9acf9f6437285fab5165329a20dd1 (diff)
Bookmarks: Clean up URLs with no path and query
-rw-r--r--src/bookmarks.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/bookmarks.c b/src/bookmarks.c
index e8cc5b98..b7e48688 100644
--- a/src/bookmarks.c
+++ b/src/bookmarks.c
@@ -139,6 +139,13 @@ void load_Bookmarks(iBookmarks *d, const char *dirPath) {
139 initSeconds_Time(&bm->when, strtod(line.start, &endPos)); 139 initSeconds_Time(&bm->when, strtod(line.start, &endPos));
140 line.start = skipSpace_CStr(endPos); 140 line.start = skipSpace_CStr(endPos);
141 setRange_String(&bm->url, line); 141 setRange_String(&bm->url, line);
142 /* Clean up the URL. */ {
143 iUrl parts;
144 init_Url(&parts, &bm->url);
145 if (isEmpty_Range(&parts.path) && isEmpty_Range(&parts.query)) {
146 appendChar_String(&bm->url, '/');
147 }
148 }
142 nextSplit_Rangecc(src, "\n", &line); 149 nextSplit_Rangecc(src, "\n", &line);
143 setRange_String(&bm->title, line); 150 setRange_String(&bm->title, line);
144 nextSplit_Rangecc(src, "\n", &line); 151 nextSplit_Rangecc(src, "\n", &line);