Skip to content

Commit da1819c

Browse files
committed
Use exact prefix for search_url entries
Instead of matching any entry that starts with the given prefix, make sure that we are matching the whole prefix until the space. This allows multiple entries to have common starting substrings. See: https://lists.mailman3.com/hyperkitty/list/dillo-dev@mailman3.com/thread/N3PO6NNPDYWPT2UVSLWTO5SZTOKIOXAI/
1 parent 6142b99 commit da1819c

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ dillo-3.3.0 [Unreleased]
2929
- Add "mark_unloaded_images" option to show a border in images not loaded, so
3030
they are easier to see.
3131
- Fix segfault on CurveBall TLS test with LibreSSL.
32+
- Match complete search prefixes in "search_url" to avoid partial matches.
3233
Patches: Rodrigo Arias Mallo
3334
+- Middle click on back or forward button opens page in new tab.
3435
Patches: Alex

src/uicmd.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,9 @@ static char *UIcmd_find_search_str(const char *str)
754754
const char *search =
755755
(const char *)dList_nth_data(prefs.search_urls, p);
756756
if (search && dStrnAsciiCasecmp(str, search, len) == 0) {
757+
/* Are we partially matching another entry? */
758+
if (search[len] != ' ')
759+
continue;
757760
prefs.search_url_idx = p;
758761
url = UIcmd_make_search_str(str + len + 1);
759762
break;

0 commit comments

Comments
 (0)