Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
UCI_HANDLE_ERR(ctx);
UCI_ASSERT(ctx, dir != NULL);
+ if (!strcmp(dir, ctx->savedir))
+ return -1;
e = uci_alloc_generic(ctx, UCI_TYPE_PATH, dir, sizeof(struct uci_element));
uci_list_add(&ctx->delta_path, &e->list);
*
* This function allows you to add directories, which contain 'overlays'
* for the active config, that will never be committed.
+ * Caller of this API should ensure that no duplicate entries (including the
+ * default search path, e.g. `UCI_SAVEDIR') should be added.
*/
extern int uci_add_delta_path(struct uci_context *ctx, const char *dir);