From bded2a02a08845d5ba3d028eeef1715bc5acc0ff Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 13 Apr 2021 19:03:06 +0200 Subject: [PATCH] pw-dump: output Spa:String:JSON values as literal Don't escape the Spa:String:JSON types in the metadata as it is supposed to be valid JSON that can be output directly. We might want to reparse and reformat it later to be sure. --- src/tools/pw-dump.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/tools/pw-dump.c b/src/tools/pw-dump.c index 179cc973c..a7ea6269d 100644 --- a/src/tools/pw-dump.c +++ b/src/tools/pw-dump.c @@ -1068,7 +1068,10 @@ static void metadata_dump(struct object *o) put_int(d, "subject", e->subject); put_value(d, "key", e->key); put_value(d, "type", e->type); - put_value(d, "value", e->value); + if (e->type != NULL && strcmp(e->type, "Spa:String:JSON") == 0) + put_literal(d, "value", e->value); + else + put_value(d, "value", e->value); put_end(d, "}", STATE_SIMPLE); e->changed = 0; }