[backfire] backport uci reorder fix from r25048
authorjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Wed, 19 Jan 2011 20:51:34 +0000 (20:51 +0000)
committerjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Wed, 19 Jan 2011 20:51:34 +0000 (20:51 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/branches/backfire@25049 3c298f89-4303-0410-b956-a3cf2f4a3e73

package/uci/Makefile
package/uci/patches/140-uci_fix_reorder.patch [new file with mode: 0644]

index 4bf89533fb145c20a950be59eb472a823cd3b3a0..7210ca29ad94f60cb4a281dc2c5a775421db15bd 100644 (file)
@@ -12,7 +12,7 @@ UCI_RELEASE=6
 
 PKG_NAME:=uci
 PKG_VERSION:=$(UCI_VERSION)$(if $(UCI_RELEASE),.$(UCI_RELEASE))
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 PKG_REV:=aa3ab8012bfbf793d2884c08ea924545a04e9544
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
diff --git a/package/uci/patches/140-uci_fix_reorder.patch b/package/uci/patches/140-uci_fix_reorder.patch
new file mode 100644 (file)
index 0000000..41c7d5d
--- /dev/null
@@ -0,0 +1,25 @@
+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)