summaryrefslogtreecommitdiff
path: root/conf.c
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-10-18 21:03:25 +0200
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-10-18 21:03:25 +0200
commit0297d897f168a185394ef28fc39ca846b22d561a (patch)
tree93ba079a8275cd81e140c7d0a9fa65fd837de359 /conf.c
parent0415b1ec23934e833b5d859aed0f12565c65b526 (diff)
dragging column headers
Diffstat (limited to 'conf.c')
-rw-r--r--conf.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/conf.c b/conf.c
index 912db783..d3702457 100644
--- a/conf.c
+++ b/conf.c
@@ -216,13 +216,23 @@ conf_setchanged (int c) {
void
conf_remove_items (const char *key) {
int l = strlen (key);
- DB_conf_item_t *it = conf_find (key, NULL);
+ DB_conf_item_t *prev = NULL;
+ DB_conf_item_t *it;
+ for (it = conf_items; it; prev = it, it = it->next) {
+ if (!strncasecmp (key, it->key, l)) {
+ break;
+ }
+ }
+ DB_conf_item_t *next = NULL;
while (it) {
- DB_conf_item_t *next = it->next;
+ next = it->next;
conf_item_free (it);
it = next;
- if (strncasecmp (key, it->key, l)) {
+ if (!it || strncasecmp (key, it->key, l)) {
break;
}
}
+ if (prev) {
+ prev->next = next;
+ }
}