From 969542c8c2f48a60c1d68b7bf70b0c00374bacba Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 6 Aug 2015 17:09:27 +0200 Subject: [PATCH] gpg: Adjust UID line indentation for common key algos. * g10/keylist.c (list_keyblock_print): Change UID line indentation * g10/mainproc.c (list_node): Ditto. -- Due to the new keyalgo/size format the UID was not anymore printed properly aligned to the creation date. Although we can't do that in any case, this change does it for common algos like "rsa2048", "dsa2048", and "ed25519". Signed-off-by: Werner Koch --- g10/keylist.c | 5 +++-- g10/mainproc.c | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/g10/keylist.c b/g10/keylist.c index b43165f2f..0f4c85ae0 100644 --- a/g10/keylist.c +++ b/g10/keylist.c @@ -1031,7 +1031,7 @@ list_keyblock_print (KBNODE keyblock, int secret, int fpr, validity = uid_trust_string_fixed (pk, uid); indent = - (keystrlen () + 9) - + (keystrlen () + (opt.legacy_list_mode? 9:11)) - atoi (uid_trust_string_fixed (NULL, NULL)); if (indent < 0 || indent > 40) @@ -1040,7 +1040,8 @@ list_keyblock_print (KBNODE keyblock, int secret, int fpr, es_fprintf (es_stdout, "uid%*s%s ", indent, "", validity); } else - es_fprintf (es_stdout, "uid%*s", (int) keystrlen () + 10, ""); + es_fprintf (es_stdout, "uid%*s", + (int) keystrlen () + (opt.legacy_list_mode? 10:12), ""); print_utf8_buffer (es_stdout, uid->name, uid->len); es_putc ('\n', es_stdout); diff --git a/g10/mainproc.c b/g10/mainproc.c index c90b9e333..f7b7c6b2c 100644 --- a/g10/mainproc.c +++ b/g10/mainproc.c @@ -1031,7 +1031,9 @@ list_node (CTX c, kbnode_t node) es_printf ("%s:::::::::", node->pkt->pkt.user_id->attrib_data?"uat":"uid"); else - es_printf ("uid%*s", 28, "" ); + es_printf ("uid%*s", + (int)keystrlen ()+(opt.legacy_list_mode? 9:11), + "" ); print_userid (node->pkt); if (opt.with_colons) es_putc (':', es_stdout);