Hi Sebastian, On Mon, Dec 08, 2014 at 12:40:48PM +0100, Sebastian Geerken wrote:
On Mon, Dec 08, 2014, v4hn wrote:
On Mon, Dec 08, 2014 at 01:11:38AM +0100, Sebastian Geerken wrote:
On Mon, Dec 08, 2014, v4hn wrote:
Talking about bugs... I just found out this version segfaults over here if I enter any string containing a space character. For example entering "foo bar" into the adress line and hitting enter segfaults over here. Can anyone reproduce this?
Yes, if and only if "search_url" is not defined. (I'm happy with DDG.) This bug occurs already in release 3.0.4.
Yes, setting search_url makes the bug disappear. Thanks for investigating!
It seems that this change fixes it:
---------------------------------------------------------------------- diff -r 9aa37b81c609 src/prefs.c --- a/src/prefs.c Tue Dec 02 16:33:49 2014 +0100 +++ b/src/prefs.c Mon Dec 08 12:37:15 2014 +0100 @@ -18,7 +18,7 @@ #define PREFS_FONT_CURSIVE "URW Chancery L" #define PREFS_FONT_FANTASY "DejaVu Sans" /* TODO: find good default */ #define PREFS_FONT_MONOSPACE "DejaVu Sans Mono" -#define PREFS_SEARCH_URL "http://duckduckgo.com/lite/?kp=-1&q=%s" +#define PREFS_SEARCH_URL "dd http://duckduckgo.com/lite/?kp=-1&q=%s" #define PREFS_NO_PROXY "localhost 127.0.0.1" #define PREFS_SAVE_DIR "/tmp/" #define PREFS_HTTP_REFERER "host" @@ -82,7 +82,6 @@ prefs.save_dir = dStrdup(PREFS_SAVE_DIR); prefs.search_urls = dList_new(16); dList_append(prefs.search_urls, dStrdup(PREFS_SEARCH_URL)); - dList_append(prefs.search_urls, NULL); /* flags a default search URL */ prefs.search_url_idx = 0; prefs.show_back = TRUE; prefs.show_bookmarks = TRUE; ----------------------------------------------------------------------
Not committed yet, since I'm not sure about the rationale.
I'd also add: diff -r 978377ed5605 src/uicmd.cc --- a/src/uicmd.cc Mon Dec 08 15:32:25 2014 +0100 +++ b/src/uicmd.cc Mon Dec 08 22:58:53 2014 -0300 @@ -682,7 +682,7 @@ static char *UIcmd_find_search_str(const for (p = 0; p < dList_length(prefs.search_urls); p++) { const char *search = (const char *)dList_nth_data(prefs.search_urls, p); - if (strncasecmp(str, search, len) == 0) { + if (search && strncasecmp(str, search, len) == 0) { prefs.search_url_idx = p; url = UIcmd_make_search_str(str + len + 1); break; (which solves the problem alone), but the cleanups above look OK to me since AFAICS: * dd as default prefix for the DDG URL is fine. * the NULL flag item is not used anymore. * dialog.cc explicitly adds the extra item for menu building (n_it+1), so the decreased number of elements is safe. -- Cheers Jorge.-