aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--g10/ChangeLog11
-rw-r--r--g10/gpgv.c8
-rw-r--r--g10/openfile.c5
-rw-r--r--g10/plaintext.c6
4 files changed, 27 insertions, 3 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index f9f60ed7c..5932bba46 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,14 @@
+2005-03-21 David Shaw <[email protected]>
+
+ * gpgv.c: Stubs for tty_enable_completion() &
+ tty_disable_completion().
+
+ * openfile.c (ask_outfile_name): Enable readline completion when
+ prompting for an output filename.
+
+ * plaintext.c (ask_for_detached_datafile): Enable readline
+ completion when prompting for a detached sig datafile.
+
2005-03-21 Werner Koch <[email protected]>
* keyedit.c (command_generator, keyedit_completion): Changed
diff --git a/g10/gpgv.c b/g10/gpgv.c
index 3e545cc9b..403504660 100644
--- a/g10/gpgv.c
+++ b/g10/gpgv.c
@@ -29,6 +29,10 @@
#ifdef HAVE_DOSISH_SYSTEM
#include <fcntl.h> /* for setmode() */
#endif
+#ifdef HAVE_LIBREADLINE
+#include <stdio.h>
+#include <readline/readline.h>
+#endif
#define INCLUDED_BY_MAIN_MODULE 1
#include "packet.h"
@@ -389,6 +393,10 @@ char *tty_get_hidden( const char *prompt ) {return NULL; }
void tty_kill_prompt(void) {}
int tty_get_answer_is_yes( const char *prompt ) {return 0;}
int tty_no_terminal(int onoff) {return 0;}
+#ifdef HAVE_LIBREADLINE
+void tty_enable_completion(rl_completion_func_t *completer) {}
+void tty_disable_completion(void) {}
+#endif
/* We do not do any locking, so use these stubs here */
void disable_dotlock(void) {}
diff --git a/g10/openfile.c b/g10/openfile.c
index 59e19a485..5454d10c0 100644
--- a/g10/openfile.c
+++ b/g10/openfile.c
@@ -1,5 +1,6 @@
/* openfile.c
- * Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
+ * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+ * 2005 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
@@ -147,8 +148,10 @@ ask_outfile_name( const char *name, size_t namelen )
sprintf(prompt, "%s [%s]: ", s, defname );
else
sprintf(prompt, "%s: ", s );
+ tty_enable_completion(NULL);
fname = cpr_get("openfile.askoutname", prompt );
cpr_kill_prompt();
+ tty_disable_completion();
m_free(prompt);
if( !*fname ) {
m_free( fname ); fname = NULL;
diff --git a/g10/plaintext.c b/g10/plaintext.c
index 6eecb6944..0c74b1e6f 100644
--- a/g10/plaintext.c
+++ b/g10/plaintext.c
@@ -1,6 +1,6 @@
/* plaintext.c - process plaintext packets
- * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003,
- * 2004 Free Software Foundation, Inc.
+ * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+ * 2005 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
@@ -446,8 +446,10 @@ ask_for_detached_datafile( MD_HANDLE md, MD_HANDLE md2,
tty_printf(_("Detached signature.\n"));
do {
m_free(answer);
+ tty_enable_completion(NULL);
answer = cpr_get("detached_signature.filename",
_("Please enter name of data file: "));
+ tty_disable_completion();
cpr_kill_prompt();
if( any && !*answer ) {
rc = G10ERR_READ_FILE;