cli: drop redundant uci_add_delta_path() call for -P
authorRafał Miłecki <rafal@milecki.pl>
Tue, 16 Aug 2022 10:08:51 +0000 (12:08 +0200)
committerRafał Miłecki <rafal@milecki.pl>
Sun, 28 Aug 2022 11:05:10 +0000 (13:05 +0200)
savedir is always present in the list of delta paths. It's guaranteed by
1. uci_alloc_context() which sets defaults
2. uci_set_savedir() which allows changing savedir

Calling uci_add_delta_path() with ctx->savedir argument seems to always
return UCI_ERR_DUPLICATE.

Fixes: 2b4872345ab2b ("make use of the history path feature in the cli")
Cc: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
cli.c

diff --git a/cli.c b/cli.c
index 2fce39d012662889cdd211db6111d8eca1eed1fe..b4c4f9574b4daf1948a3e4be703ee48cd75fd5e6 100644 (file)
--- a/cli.c
+++ b/cli.c
@@ -748,7 +748,6 @@ int main(int argc, char **argv)
                                uci_add_delta_path(ctx, optarg);
                                break;
                        case 'P':
-                               uci_add_delta_path(ctx, ctx->savedir);
                                uci_set_savedir(ctx, optarg);
                                flags |= CLI_FLAG_NOCOMMIT;
                                break;