1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-12-27 14:08:58 +02:00
openwrt-xburst/package/uci/patches/140-uci_fix_reorder.patch
jow 762d03aef2 [backfire] backport uci reorder fix from r25048
git-svn-id: svn://svn.openwrt.org/openwrt/branches/backfire@25049 3c298f89-4303-0410-b956-a3cf2f4a3e73
2011-01-19 20:51:34 +00:00

26 lines
750 B
Diff

From: Felix Fietkau <nbd@openwrt.org>
Date: Wed, 19 Jan 2011 20:30:35 +0000 (+0100)
Subject: fix uci_list_set_pos to reorder sections properly, even when moving a section to ...
X-Git-Url: http://nbd.name/gitweb.cgi?p=uci.git;a=commitdiff_plain;h=a5eb996e0f04d911ff61479508bbc3e17b16ff0c
fix uci_list_set_pos to reorder sections properly, even when moving a section to the last position
---
--- a/list.c
+++ b/list.c
@@ -55,11 +55,12 @@ static inline void uci_list_set_pos(stru
uci_list_del(ptr);
uci_foreach_element(head, p) {
- new_head = &p->list;
if (pos-- <= 0)
break;
+ new_head = &p->list;
}
- uci_list_add(new_head, ptr);
+
+ uci_list_add(new_head->next, ptr);
}
static inline void uci_list_fixup(struct uci_list *ptr)