From a4b26187216bd3f8e941190df3aa673a746e1ae5 Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@collabora.com>
Date: Mon, 12 Aug 2019 18:17:27 +0100
Subject: [PATCH] inspect-library: Don't produce malformed JSON if the ABI is
 not known

If we don't know what symbols we're looking for, we need to print a
comma to follow "path" and precede "dependencies".

Signed-off-by: Simon McVittie <smcv@collabora.com>
---
 helpers/inspect-library.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/helpers/inspect-library.c b/helpers/inspect-library.c
index 47ba7c024..5467eee53 100644
--- a/helpers/inspect-library.c
+++ b/helpers/inspect-library.c
@@ -327,7 +327,7 @@ main (int argc,
           print_json_string_content (entry);
           printf ("\"");
         }
-      printf ("\n    ],");
+      printf ("\n    ]");
 
       free (missing_symbols);
       free (misversioned_symbols);
@@ -339,7 +339,7 @@ main (int argc,
   while (dep_map != NULL && dep_map->l_prev != NULL)
     dep_map = dep_map->l_prev;
 
-  printf ("\n    \"dependencies\": [");
+  printf (",\n    \"dependencies\": [");
   first = true;
   for (; dep_map != NULL; dep_map = dep_map->l_next)
     {
-- 
GitLab