From a1a5d097891abd6ac62d4af825a2507980a9f1a0 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Thu, 26 May 2016 09:26:09 +0100 Subject: [PATCH] key/key-io.c: Produce valid key lines for empty keys. If a key contains only an empty tree of structures, then `key_write' returns an empty string, which breaks the whitespace-separated field structure of the output key line. Notice this and insert an empty structure by hand as an unpleasant bodge. The resulting key is still highly anomalous. In particular, it doesn't match any filter, because structure nodes don't have flags. I don't know what to do about this. --- key/key-io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/key/key-io.c b/key/key-io.c index b2dc9189..c79c8e06 100644 --- a/key/key-io.c +++ b/key/key-io.c @@ -352,7 +352,7 @@ int key_extract(key_file *f, key *k, FILE *fp, const key_filter *kf) key_fulltag(k, &d); DPUTC(&d, ' '); - key_write(k->k, &d, kf); + if (!key_write(k->k, &d, kf)) dstr_puts(&d, "struct:[]"); DPUTC(&d, ' '); dstr_write(&d, fp); DRESET(&d); -- 2.11.0