diff --git a/g10/ChangeLog b/g10/ChangeLog index 152fa8033..519766d46 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,8 @@ +2005-08-31 David Shaw + + * photoid.c (generate_photo_id): Enable readline completion and + tilde expansion for the JPEG prompt. + 2005-08-26 David Shaw * misc.c (openpgp_pk_algo_usage): Default to allowing CERT for diff --git a/g10/photoid.c b/g10/photoid.c index aae983fe0..5dd4e436a 100644 --- a/g10/photoid.c +++ b/g10/photoid.c @@ -1,5 +1,5 @@ /* photoid.c - photo ID handling code - * Copyright (C) 2001, 2002 Free Software Foundation, Inc. + * Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc. * * This file is part of GnuPG. * @@ -43,7 +43,8 @@ #include "ttyio.h" /* Generate a new photo id packet, or return NULL if canceled */ -PKT_user_id *generate_photo_id(PKT_public_key *pk) +PKT_user_id * +generate_photo_id(PKT_public_key *pk) { PKT_user_id *uid; int error=1,i; @@ -73,13 +74,23 @@ PKT_user_id *generate_photo_id(PKT_public_key *pk) while(photo==NULL) { + char *tempname; + tty_printf("\n"); xfree(filename); - filename=cpr_get("photoid.jpeg.add", + tty_enable_completion(NULL); + + tempname=cpr_get("photoid.jpeg.add", _("Enter JPEG filename for photo ID: ")); + tty_disable_completion(); + + filename=make_filename(tempname,(void *)NULL); + + xfree(tempname); + if(strlen(filename)==0) goto scram;