validation NEW duplicate instances
Also trees structure removed, some
refactoring included.
diff --git a/tools/lint/commands.c b/tools/lint/commands.c
index 67c0e53..b397950 100644
--- a/tools/lint/commands.c
+++ b/tools/lint/commands.c
@@ -545,7 +545,7 @@
}
static int
-parse_data(char *filepath, int *options, const struct lyd_node **trees, const char *rpc_act_file,
+parse_data(char *filepath, int *options, const struct lyd_node *tree, const char *rpc_act_file,
struct lyd_node **result)
{
LYD_FORMAT informat = LYD_UNKNOWN;
@@ -696,8 +696,8 @@
int options = 0, printopt = 0;
char **argv = NULL, *ptr;
const char *out_path = NULL;
- struct lyd_node *data = NULL, *val_tree = NULL;
- const struct lyd_node **trees = NULL;
+ struct lyd_node *data = NULL;
+ struct lyd_node *tree = NULL;
LYD_FORMAT outformat = LYD_UNKNOWN;
FILE *output = stdout;
static struct option long_options[] = {
@@ -829,7 +829,7 @@
goto cleanup;
}
- if (parse_data(argv[optind], &options, trees, argv[optind + 1], &data)) {
+ if (parse_data(argv[optind], &options, tree, argv[optind + 1], &data)) {
goto cleanup;
}
@@ -855,7 +855,6 @@
fclose(output);
}
- lyd_trees_free(trees, 1);
lyd_free_all(data);
return ret;