chiark / gitweb /
busctl: fix 'command line' style output of properties
authorLennart Poettering <lennart@poettering.net>
Tue, 2 Dec 2014 11:58:13 +0000 (12:58 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 2 Dec 2014 12:23:04 +0000 (13:23 +0100)
src/libsystemd/sd-bus/busctl.c

index 1ba4e8a..dd6ae86 100644 (file)
@@ -538,7 +538,7 @@ static int format_cmdline(sd_bus_message *m, FILE *f, bool needs_space) {
                                 fprintf(f, "%s", contents);
                         }
 
-                        r = format_cmdline(m, f, true);
+                        r = format_cmdline(m, f, needs_space || IN_SET(type, SD_BUS_TYPE_ARRAY, SD_BUS_TYPE_VARIANT));
                         if (r < 0)
                                 return r;
 
@@ -614,6 +614,7 @@ static int format_cmdline(sd_bus_message *m, FILE *f, bool needs_space) {
                         assert_not_reached("Unknown basic type.");
                 }
 
+                needs_space = true;
         }
 }