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.
This commit is contained in:
Wim Taymans 2021-04-13 19:03:06 +02:00
parent d8e3f9b801
commit bded2a02a0

View file

@ -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;
}