aboutsummaryrefslogtreecommitdiffstats
path: root/util/ttyio.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>1998-09-11 05:47:32 +0000
committerWerner Koch <[email protected]>1998-09-11 05:47:32 +0000
commit48da5f940b537b09b1fd6a5023922bd792d5954c (patch)
treed0b99173fc76c70960ace7d372d4adeff969652b /util/ttyio.c
parentChnages. (diff)
downloadgnupg-48da5f940b537b09b1fd6a5023922bd792d5954c.tar.gz
gnupg-48da5f940b537b09b1fd6a5023922bd792d5954c.zip
*** empty log message ***
Diffstat (limited to 'util/ttyio.c')
-rw-r--r--util/ttyio.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/util/ttyio.c b/util/ttyio.c
index 38143cba5..9f095d86e 100644
--- a/util/ttyio.c
+++ b/util/ttyio.c
@@ -39,6 +39,8 @@
#include "memory.h"
#include "ttyio.h"
+#define CONTROL_D ('D' - 'A' + 1)
+
#ifdef __MINGW32__ /* use the odd Win32 functions */
static struct {
@@ -279,6 +281,8 @@ do_get( const char *prompt, int hidden )
if( !hidden )
last_prompt_len++;
c = *cbuf;
+ if( c == CONTROL_D )
+ log_info("control d found\n");
if( c == '\t' )
c = ' ';
else if( c > 0xa0 )
@@ -292,6 +296,10 @@ do_get( const char *prompt, int hidden )
}
buf[i++] = c;
}
+ if( *cbuf != '\n' ) {
+ buf[0] = CONTROL_D;
+ i = 1;
+ }
if( hidden ) {