[OpenWrt-Devel] [PATCH 2/2] delta: fix adding new savedir.

Yousong Zhou yszhou4tech at gmail.com
Wed Apr 1 08:44:23 EDT 2015


Newly added savedir should be at the last position while
uci_add_delta_path() will add it to the position second to the last.

Signed-off-by: Yousong Zhou <yszhou4tech at gmail.com>
---
 delta.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/delta.c b/delta.c
index 357f5c7..459d2c7 100644
--- a/delta.c
+++ b/delta.c
@@ -114,9 +114,8 @@ int uci_set_savedir(struct uci_context *ctx, const char *dir)
 		}
 	}
 	if (!exists)
-		UCI_INTERNAL(uci_add_delta_path, ctx, dir);
-	else
-		uci_list_add(&ctx->delta_path, &e->list);
+		e = uci_alloc_generic(ctx, UCI_TYPE_PATH, dir, sizeof(struct uci_element));
+	uci_list_add(&ctx->delta_path, &e->list);
 
 	sdir = uci_strdup(ctx, dir);
 	if (ctx->savedir != uci_savedir)
-- 
1.7.10.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list