diff options
Diffstat (limited to 'util/ttyio.c')
-rw-r--r-- | util/ttyio.c | 8 |
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 ) { |