From bf079613b7082a6aa95e067c535a9e74ecad490b Mon Sep 17 00:00:00 2001 From: David Shaw Date: Mon, 11 Oct 2004 21:08:37 +0000 Subject: [PATCH] * pkclist.c (do_edit_ownertrust): Use the same translated string for showing the user ID as mainproc.c:print_pkenc_list. * mainproc.c (print_pkenc_list): Allow translating the quotes around the user ID. * card-util.c, g10.c, photoid.c, trustdb.c: The last of the \"%s\" -> `%s' quoting for things that aren't user IDs. * keyserver.c (keyserver_spawn): If there is no keyserver host, print the whole URI since it is self-contained. --- g10/ChangeLog | 14 ++++++++++++++ g10/card-util.c | 2 +- g10/g10.c | 8 ++++---- g10/keyserver.c | 29 +++++++++++++++++++++-------- g10/mainproc.c | 9 +++------ g10/photoid.c | 4 ++-- g10/pkclist.c | 4 ++-- g10/trustdb.c | 8 ++++---- 8 files changed, 51 insertions(+), 27 deletions(-) diff --git a/g10/ChangeLog b/g10/ChangeLog index b98a377f4..ba899b29d 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,17 @@ +2004-10-11 David Shaw + + * pkclist.c (do_edit_ownertrust): Use the same translated string + for showing the user ID as mainproc.c:print_pkenc_list. + + * mainproc.c (print_pkenc_list): Allow translating the quotes + around the user ID. + + * card-util.c, g10.c, photoid.c, trustdb.c: The last of the \"%s\" + -> `%s' quoting for things that aren't user IDs. + + * keyserver.c (keyserver_spawn): If there is no keyserver host, + print the whole URI since it is self-contained. + 2004-10-11 Werner Koch * keyserver.c (keyserver_spawn): Print an empty string in log_info diff --git a/g10/card-util.c b/g10/card-util.c index 7314ee478..8f638c930 100644 --- a/g10/card-util.c +++ b/g10/card-util.c @@ -912,7 +912,7 @@ generate_card_keys (const char *serialno) { tty_printf ("\n"); tty_printf (_("Please note that the factory settings of the PINs are\n" - " PIN = \"%s\" Admin PIN = \"%s\"\n" + " PIN = `%s' Admin PIN = `%s'\n" "You should change them using the command --change-pin\n"), "123456", "12345678"); tty_printf ("\n"); diff --git a/g10/g10.c b/g10/g10.c index 85c27d424..366fac041 100644 --- a/g10/g10.c +++ b/g10/g10.c @@ -971,7 +971,7 @@ add_group(char *string) name=strsep(&string,"="); if(string==NULL) { - log_error(_("no = sign found in group definition \"%s\"\n"),name); + log_error(_("no = sign found in group definition `%s'\n"),name); return; } @@ -2002,7 +2002,7 @@ main( int argc, char **argv ) else if(ascii_strcasecmp(pargs.r.ret_str,"auto")==0) opt.trust_model=TM_AUTO; else - log_error("unknown trust model \"%s\"\n",pargs.r.ret_str); + log_error("unknown trust model `%s'\n",pargs.r.ret_str); break; case oForceOwnertrust: log_info(_("NOTE: %s is not for normal use!\n"), @@ -2010,7 +2010,7 @@ main( int argc, char **argv ) opt.force_ownertrust=string_to_trust_value(pargs.r.ret_str); if(opt.force_ownertrust==-1) { - log_error("invalid ownertrust \"%s\"\n",pargs.r.ret_str); + log_error("invalid ownertrust `%s'\n",pargs.r.ret_str); opt.force_ownertrust=0; } break; @@ -2452,7 +2452,7 @@ main( int argc, char **argv ) else if(ascii_strcasecmp(pargs.r.ret_str,"0xlong")==0) opt.keyid_format=KF_0xLONG; else - log_error("unknown keyid-format \"%s\"\n",pargs.r.ret_str); + log_error("unknown keyid-format `%s'\n",pargs.r.ret_str); break; default : pargs.err = configfp? 1:2; break; diff --git a/g10/keyserver.c b/g10/keyserver.c index 5e29efdf2..e0eebf320 100644 --- a/g10/keyserver.c +++ b/g10/keyserver.c @@ -892,9 +892,13 @@ keyserver_spawn(int action,STRLIST list,KEYDB_SEARCH_DESC *desc, else BUG(); - log_info(_("requesting key %s from %s server %s\n"), - keystr_from_desc(&desc[i]), - keyserver->scheme,keyserver->host?keyserver->host:""); + if(keyserver->host) + log_info(_("requesting key %s from %s server %s\n"), + keystr_from_desc(&desc[i]), + keyserver->scheme,keyserver->host); + else + log_info(_("requesting key %s from %s\n"), + keystr_from_desc(&desc[i]),keyserver->uri); } fprintf(spawn->tochild,"\n"); @@ -1037,9 +1041,14 @@ keyserver_spawn(int action,STRLIST list,KEYDB_SEARCH_DESC *desc, iobuf_close(buffer); - log_info(_("sending key %s to %s server %s\n"), - keystr(block->pkt->pkt.public_key->keyid), - keyserver->scheme,keyserver->host?keyserver->host:""); + if(keyserver->host) + log_info(_("sending key %s to %s server %s\n"), + keystr(block->pkt->pkt.public_key->keyid), + keyserver->scheme,keyserver->host); + else + log_info(_("sending key %s to %s\n"), + keystr(block->pkt->pkt.public_key->keyid), + keyserver->uri); release_kbnode(block); } @@ -1079,8 +1088,12 @@ keyserver_spawn(int action,STRLIST list,KEYDB_SEARCH_DESC *desc, fprintf(spawn->tochild,"\n"); - log_info(_("searching for \"%s\" from %s server %s\n"), - searchstr,keyserver->scheme,keyserver->host?keyserver->host:""); + if(keyserver->host) + log_info(_("searching for \"%s\" from %s server %s\n"), + searchstr,keyserver->scheme,keyserver->host); + else + log_info(_("searching for \"%s\" from %s\n"), + searchstr,keyserver->uri); break; } diff --git a/g10/mainproc.c b/g10/mainproc.c index a1daa9c04..138a85542 100644 --- a/g10/mainproc.c +++ b/g10/mainproc.c @@ -457,16 +457,13 @@ print_pkenc_list( struct kidlist_item *list, int failed ) pk->pubkey_algo = list->pubkey_algo; if( !get_pubkey( pk, list->kid ) ) { - size_t n; char *p; log_info( _("encrypted with %u-bit %s key, ID %s, created %s\n"), nbits_from_pk( pk ), algstr, keystr_from_pk(pk), strtimestamp(pk->timestamp) ); - fputs(" \"", log_stream() ); - p = get_user_id( list->kid, &n ); - print_utf8_string2 ( log_stream(), p, n, '"' ); + p=get_user_id_native(list->kid); + fprintf(log_stream(),_(" \"%s\"\n"),p); m_free(p); - fputs("\"\n", log_stream() ); } else log_info(_("encrypted with %s key, ID %s\n"), @@ -579,7 +576,7 @@ proc_encrypted( CTX c, PACKET *pkt ) sprintf ( buf, "%d:", c->dek->algo ); for(i=0; i < c->dek->keylen; i++ ) sprintf(buf+strlen(buf), "%02X", c->dek->key[i] ); - log_info( "session key: \"%s\"\n", buf ); + log_info( "session key: `%s'\n", buf ); write_status_text ( STATUS_SESSION_KEY, buf ); } } diff --git a/g10/photoid.c b/g10/photoid.c index 2e9993595..9487c0fb9 100644 --- a/g10/photoid.c +++ b/g10/photoid.c @@ -85,7 +85,7 @@ PKT_user_id *generate_photo_id(PKT_public_key *pk) file=iobuf_open(filename); if(!file) { - log_error(_("Unable to open photo \"%s\": %s\n"), + log_error(_("Unable to open JPEG file `%s': %s\n"), filename,strerror(errno)); continue; } @@ -110,7 +110,7 @@ PKT_user_id *generate_photo_id(PKT_public_key *pk) if(photo[0]!=0xFF || photo[1]!=0xD8 || photo[6]!='J' || photo[7]!='F' || photo[8]!='I' || photo[9]!='F') { - log_error(_("\"%s\" is not a JPEG file\n"),filename); + log_error(_("`%s' is not a JPEG file\n"),filename); m_free(photo); photo=NULL; continue; diff --git a/g10/pkclist.c b/g10/pkclist.c index 8d869cd61..359a3de2e 100644 --- a/g10/pkclist.c +++ b/g10/pkclist.c @@ -204,7 +204,7 @@ do_edit_ownertrust (PKT_public_key *pk, int mode, pubkey_letter( pk->pubkey_algo ), keystr(keyid), datestr_from_pk( pk ) ); p=get_user_id_native(keyid); - tty_printf(_(" \"%s\"\n"),p); + tty_printf(_(" \"%s\"\n"),p); m_free(p); keyblock = get_pubkeyblock (keyid); @@ -231,7 +231,7 @@ do_edit_ownertrust (PKT_public_key *pk, int mode, p=utf8_to_native(un->pkt->pkt.user_id->name, un->pkt->pkt.user_id->len,0); - tty_printf(_(" aka \"%s\"\n"),p); + tty_printf(_(" aka \"%s\"\n"),p); } print_fingerprint (pk, NULL, 2); diff --git a/g10/trustdb.c b/g10/trustdb.c index 9cf2eff67..3052281ab 100644 --- a/g10/trustdb.c +++ b/g10/trustdb.c @@ -556,7 +556,7 @@ check_trustdb () validate_keys (0); } else - log_info (_("no need for a trustdb check with \"%s\" trust model\n"), + log_info (_("no need for a trustdb check with `%s' trust model\n"), trust_model_string()); } @@ -571,7 +571,7 @@ update_trustdb() if(opt.trust_model==TM_PGP || opt.trust_model==TM_CLASSIC) validate_keys (1); else - log_info (_("no need for a trustdb update with \"%s\" trust model\n"), + log_info (_("no need for a trustdb update with `%s' trust model\n"), trust_model_string()); } @@ -1527,7 +1527,7 @@ check_regexp(const char *expr,const char *string) regfree(&pat); if(DBG_TRUST) - log_debug("regexp \"%s\" on \"%s\": %s\n",expr,string,ret==0?"YES":"NO"); + log_debug("regexp `%s' on `%s': %s\n",expr,string,ret==0?"YES":"NO"); return (ret==0); #endif @@ -1987,7 +1987,7 @@ validate_keys (int interactive) { if(DBG_TRUST) log_debug("key %08lX%08lX:" - " overriding ownertrust \"%s\" with \"%s\"\n", + " overriding ownertrust `%s' with `%s'\n", (ulong)k->kid[0],(ulong)k->kid[1], trust_value_to_string(k->ownertrust), trust_value_to_string(min));