From c93f2642157418357fb3643e29307edaf2bf9d0c Mon Sep 17 00:00:00 2001 From: Olof hagsand Date: Sat, 29 Oct 2022 16:06:15 +0200 Subject: [PATCH] Added final \n to JSON pretty-print output This was a correction of fix to: [CLI Show config JSON with multiple top-level elements is broken](https://github.com/clicon/clixon/issues/381) --- apps/cli/cli_show.c | 11 ----------- lib/src/clixon_json.c | 4 +--- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/apps/cli/cli_show.c b/apps/cli/cli_show.c index 469a58f8..e7ac5136 100644 --- a/apps/cli/cli_show.c +++ b/apps/cli/cli_show.c @@ -436,8 +436,6 @@ cli_show_common(clicon_handle h, cxobj **vec = NULL; size_t veclen; cxobj *xp; - yang_stmt *yp; - enum rfc_6020 ys_keyword; int i; if (state && strcmp(db, "running") != 0){ @@ -471,11 +469,6 @@ cli_show_common(clicon_handle h, if (xpath_vec(xt, nsc, "%s", &vec, &veclen, xpath) < 0) goto done; if (veclen){ - xp = vec[0]; /* First peek to see if it is special case yang list */ - if ((yp = xml_spec(xp)) != NULL) - ys_keyword = yang_keyword_get(xml_spec(xp)); - else - ys_keyword = 0; /* Special case LIST */ if (format == FORMAT_JSON){ switch (format){ @@ -490,10 +483,6 @@ cli_show_common(clicon_handle h, else /* Default */ for (i=0; i