]> pilppa.org Git - uci.git/blobdiff - cli.c
fix possible uninitialized warning from gcc 4.92
[uci.git] / cli.c
diff --git a/cli.c b/cli.c
index 7bef7a907d876ecfc24bab0169a7ee41cff88b0e..41179d70e2dae16865237436126591e946039fb3 100644 (file)
--- a/cli.c
+++ b/cli.c
@@ -224,8 +224,8 @@ static void uci_show_changes(struct uci_package *p)
 {
        struct uci_element *e;
 
-       uci_foreach_element(&p->saved_history, e) {
-               struct uci_history *h = uci_to_history(e);
+       uci_foreach_element(&p->saved_delta, e) {
+               struct uci_delta *h = uci_to_delta(e);
                char *prefix = "";
                char *op = "=";
 
@@ -403,6 +403,7 @@ static int uci_do_section_cmd(int cmd, int argc, char **argv)
        if (argc != 2)
                return 255;
 
+  printf("argv[1]: %s\n", argv[1]);
        if (uci_lookup_ptr(ctx, &ptr, argv[1], true) != UCI_OK) {
                cli_perror();
                return 1;
@@ -585,8 +586,9 @@ static int uci_cmd(int argc, char **argv)
                case CMD_DEL:
                case CMD_RENAME:
                case CMD_REVERT:
-               case CMD_REORDER:
+               case CMD_REORDER: {
                        return uci_do_section_cmd(cmd, argc, argv);
+    }
                case CMD_SHOW:
                case CMD_EXPORT:
                case CMD_COMMIT:
@@ -653,10 +655,10 @@ int main(int argc, char **argv)
                                ctx->flags &= ~UCI_FLAG_EXPORT_NAME;
                                break;
                        case 'p':
-                               uci_add_history_path(ctx, optarg);
+                               uci_add_delta_path(ctx, optarg);
                                break;
                        case 'P':
-                               uci_add_history_path(ctx, ctx->savedir);
+                               uci_add_delta_path(ctx, ctx->savedir);
                                uci_set_savedir(ctx, optarg);
                                flags |= CLI_FLAG_NOCOMMIT;
                                break;