diff options
author | Jorge Arellano Cid <jcid@dillo.org> | 2014-12-10 09:57:07 -0300 |
---|---|---|
committer | Jorge Arellano Cid <jcid@dillo.org> | 2014-12-10 09:57:07 -0300 |
commit | d3c58fd2e9422282fcc43491233191ad32067aa8 (patch) | |
tree | 4ca2493a91157d09992928a3604845d82ca2c5a6 | |
parent | f2157b26e98ed14c4e3725e320302324eb3192ce (diff) |
Avoid a corner case segfault when no search URL is found in dillorc.
e.g. entering a space containing sring in address bar.
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | src/prefs.c | 3 | ||||
-rw-r--r-- | src/uicmd.cc | 4 |
3 files changed, 5 insertions, 4 deletions
@@ -8,6 +8,8 @@ at http://hg.dillo.org/dillo dillo-3.0.4.1 [not released yet] ++- Avoid a corner case segfault when no search URL is found in dillorc. + Patch: Sebastian Geerken, Jorge Arellano +- Fix linking problem with fltk-1.3.3 and fl_oldfocus. Patch: Jorge Arellano Cid +- Don't load background images in --local mode. diff --git a/src/prefs.c b/src/prefs.c index cd13aac8..fbd17f33 100644 --- a/src/prefs.c +++ b/src/prefs.c @@ -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" @@ -79,7 +79,6 @@ void a_Prefs_init(void) 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; diff --git a/src/uicmd.cc b/src/uicmd.cc index e09bbf60..e1100219 100644 --- a/src/uicmd.cc +++ b/src/uicmd.cc @@ -669,7 +669,7 @@ static char *UIcmd_find_search_str(const char *str) 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; @@ -920,7 +920,7 @@ static int UIcmd_save_file_check(const char *name) int ch; ds = dStr_sized_new(128); dStr_sprintf(ds, - "The file:\n %s (%d Bytes)\nalready exists. What do we do?", + "The file:\n %s (%d Bytes)\nalready exists. What do we do?", name, (int)ss.st_size); ch = a_Dialog_choice("Dillo Save: File exists!", ds->str, "Abort", "Continue", "Rename", NULL); |