aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2005-08-31 18:40:39 +0000
committerDavid Shaw <[email protected]>2005-08-31 18:40:39 +0000
commit187eaf0665b812b26c5b258d7b9a5aae4cc2b87e (patch)
tree74f073c8495d5bde570a6d15ab9769196a533728
parent* fileutil.c (untilde): New. Expand ~/foo and ~username/foo filenames (diff)
downloadgnupg-187eaf0665b812b26c5b258d7b9a5aae4cc2b87e.tar.gz
gnupg-187eaf0665b812b26c5b258d7b9a5aae4cc2b87e.zip
* photoid.c (generate_photo_id): Enable readline completion and tilde
expansion for the JPEG prompt.
-rw-r--r--g10/ChangeLog5
-rw-r--r--g10/photoid.c17
2 files changed, 19 insertions, 3 deletions
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 <[email protected]>
+
+ * photoid.c (generate_photo_id): Enable readline completion and
+ tilde expansion for the JPEG prompt.
+
2005-08-26 David Shaw <[email protected]>
* 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;