diff options
author | Alexey Yakovenko <wakeroid@gmail.com> | 2009-10-18 21:03:25 +0200 |
---|---|---|
committer | Alexey Yakovenko <wakeroid@gmail.com> | 2009-10-18 21:03:25 +0200 |
commit | 0297d897f168a185394ef28fc39ca846b22d561a (patch) | |
tree | 93ba079a8275cd81e140c7d0a9fa65fd837de359 /conf.c | |
parent | 0415b1ec23934e833b5d859aed0f12565c65b526 (diff) |
dragging column headers
Diffstat (limited to 'conf.c')
-rw-r--r-- | conf.c | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -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; + } } |