]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Fix .status storage output
authorEric Bollengier <eric@baculasystems.com>
Wed, 8 Dec 2021 13:37:42 +0000 (14:37 +0100)
committerEric Bollengier <eric@baculasystems.com>
Thu, 14 Sep 2023 11:56:56 +0000 (13:56 +0200)
bacula/src/lib/output.c

index 3fa9004f049517742cee7bd9c075cffcbdd54729..8f5029d9c993f39090744cc322ac51e9afccd0eb 100644 (file)
@@ -234,6 +234,15 @@ char *OutputWriter::start_list(const char *name, bool append)
       will_need_separator = false;
 
    } else {
+      if (*buf) {
+         int l = strlen(buf);
+         if (buf[l - 1] != separator) {
+            char ed1[2];
+            ed1[0] = separator;
+            ed1[1] = '\0';
+            pm_strcat(buf, ed1);
+         }
+      }
       pm_strcat(buf, name);
       pm_strcat(buf, ": [\n");
    }