aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2015-02-15 19:27:04 +0100
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2015-02-15 19:27:04 +0100
commit5ea0dee4a43a723305d536cb73ddd4264a06eccd (patch)
tree20f5a3775bd0c1a178802c33ca742266dea8ff26
parentc5d6c40916eeeb19a89961cc3b81368c785be06d (diff)
use new count field to override default search url
-rw-r--r--src/prefsparser.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/prefsparser.cc b/src/prefsparser.cc
index ba569c0a..de0e9225 100644
--- a/src/prefsparser.cc
+++ b/src/prefsparser.cc
@@ -82,12 +82,13 @@ static int parseOption(char *name, char *value,
case PREFS_STRINGS:
{
Dlist *lp = *(Dlist **)node->pref;
- if (dList_length(lp) == 2 && !dList_nth_data(lp, 1)) {
+ if (node->count == 0) {
/* override the default */
- void *data = dList_nth_data(lp, 0);
- dList_remove(lp, data);
- dList_remove(lp, NULL);
- dFree(data);
+ for (i = 0; i < dList_length(lp); i++) {
+ void *data = dList_nth_data(lp, i);
+ dList_remove(lp, data);
+ dFree(dList_nth_data(lp, i));
+ }
}
dList_append(lp, dStrdup(value));
break;