From d937ace2f83ed4def3a5c1dee8daba0f371f0072 Mon Sep 17 00:00:00 2001 From: David Shaw Date: Wed, 22 Sep 2004 03:16:41 +0000 Subject: [PATCH] * mainproc.c (check_sig_and_print), keyedit.c (show_prefs, menu_set_keyserver_url): Make sure that keyserver URLs with control characters inside are printed properly. In fact, handle them as UTF8. --- g10/ChangeLog | 5 +++++ g10/keyedit.c | 14 +++++++++----- g10/mainproc.c | 2 +- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/g10/ChangeLog b/g10/ChangeLog index 54d766c56..81e4c27fb 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,5 +1,10 @@ 2004-09-21 David Shaw + * mainproc.c (check_sig_and_print), keyedit.c (show_prefs, + menu_set_keyserver_url): Make sure that keyserver URLs with + control characters inside are printed properly. In fact, handle + them as UTF8. + * keyedit.c (keyedit_menu): Don't show "addcardkey" in the menu if we do not have card support. diff --git a/g10/keyedit.c b/g10/keyedit.c index 95213f7d1..0a9b47b58 100644 --- a/g10/keyedit.c +++ b/g10/keyedit.c @@ -1910,7 +1910,9 @@ show_prefs (PKT_user_id *uid, PKT_signature *selfsig, int verbose) if(pref_ks && pref_ks_len) { tty_printf (" "); - tty_printf("Preferred keyserver: %.*s\n",pref_ks_len,pref_ks); + tty_printf(_("Preferred keyserver: ")); + tty_print_utf8_string(pref_ks,pref_ks_len); + tty_printf("\n"); } } else { @@ -3170,7 +3172,7 @@ menu_set_primary_uid ( KBNODE pub_keyblock, KBNODE sec_keyblock ) if(sig->version < 4) { char *user=utf8_to_native(uid->name,strlen(uid->name),0); - log_info(_("skipping v3 self-signature on user id \"%s\"\n"), + log_info(_("skipping v3 self-signature on user ID \"%s\"\n"), user); m_free(user); } @@ -3280,7 +3282,7 @@ menu_set_preferences (KBNODE pub_keyblock, KBNODE sec_keyblock ) if( sig->version < 4 ) { char *user=utf8_to_native(uid->name,strlen(uid->name),0); - log_info(_("skipping v3 self-signature on user id \"%s\"\n"), + log_info(_("skipping v3 self-signature on user ID \"%s\"\n"), user); m_free(user); } @@ -3399,7 +3401,7 @@ menu_set_keyserver_url (const char *url, { char *user=utf8_to_native(uid->name,strlen(uid->name),0); if( sig->version < 4 ) - log_info(_("skipping v3 self-signature on user id \"%s\"\n"), + log_info(_("skipping v3 self-signature on user ID \"%s\"\n"), user); else { @@ -3416,7 +3418,9 @@ menu_set_keyserver_url (const char *url, if(p && plen) { tty_printf("Current preferred keyserver for user" - " ID \"%s\": %.*s\n",user,plen,p); + " ID \"%s\": ",user); + tty_print_utf8_string(p,plen); + tty_printf("\n"); if(!cpr_get_answer_is_yes("keyedit.confirm_keyserver", uri?_("Are you sure you want to replace it? (y/N) "): _("Are you sure you want to delete it? (y/N) "))) diff --git a/g10/mainproc.c b/g10/mainproc.c index 5258d57ca..f373de788 100644 --- a/g10/mainproc.c +++ b/g10/mainproc.c @@ -1368,7 +1368,7 @@ check_sig_and_print( CTX c, KBNODE node ) page, but "from" if it is located on a keyserver. I'm not going to even try to make two strings here :) */ log_info(_("Key available at: ") ); - print_string( log_stream(), p, n, 0 ); + print_utf8_string( log_stream(), p, n ); putc( '\n', log_stream() ); if(opt.keyserver_options.options&KEYSERVER_AUTO_KEY_RETRIEVE