From 21669124f2600376b8ec12d0710c56b1838bff0c Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Fri, 18 Dec 2020 22:01:58 +0200 Subject: Bookmarks: Clean up URLs with no path and query --- src/bookmarks.c | 7 +++++++ 1 file changed, 7 insertions(+) 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) { initSeconds_Time(&bm->when, strtod(line.start, &endPos)); line.start = skipSpace_CStr(endPos); setRange_String(&bm->url, line); + /* Clean up the URL. */ { + iUrl parts; + init_Url(&parts, &bm->url); + if (isEmpty_Range(&parts.path) && isEmpty_Range(&parts.query)) { + appendChar_String(&bm->url, '/'); + } + } nextSplit_Rangecc(src, "\n", &line); setRange_String(&bm->title, line); nextSplit_Rangecc(src, "\n", &line); -- cgit v1.2.3