diff options
author | David Shaw <[email protected]> | 2005-12-12 03:56:01 +0000 |
---|---|---|
committer | David Shaw <[email protected]> | 2005-12-12 03:56:01 +0000 |
commit | b12d50dccd0a1d54cad10bde3ed6bd94070518c9 (patch) | |
tree | 9971e2ac5353eb5f84c03e795a3f8378eeb93040 | |
parent | * NEWS: Note --fetch-keys. (diff) | |
download | gnupg-b12d50dccd0a1d54cad10bde3ed6bd94070518c9.tar.gz gnupg-b12d50dccd0a1d54cad10bde3ed6bd94070518c9.zip |
* ttyio.c (tty_enable_completion, tty_disable_completion): Add checks
for no_terminal so we don't try to open("/dev/tty") when invoked with
--no-tty.
Diffstat (limited to '')
-rw-r--r-- | util/ChangeLog | 6 | ||||
-rw-r--r-- | util/ttyio.c | 8 |
2 files changed, 14 insertions, 0 deletions
diff --git a/util/ChangeLog b/util/ChangeLog index 754b9d277..0834f5b47 100644 --- a/util/ChangeLog +++ b/util/ChangeLog @@ -1,3 +1,9 @@ +2005-12-10 Ryan Lortie <[email protected]> (dshaw) + + * ttyio.c (tty_enable_completion, tty_disable_completion): Add + checks for no_terminal so we don't try to open("/dev/tty") when + invoked with --no-tty. + 2005-12-06 David Shaw <[email protected]> * Makefile.am: Some cleanup so we don't build files that are diff --git a/util/ttyio.c b/util/ttyio.c index 63a68a380..97b160ef2 100644 --- a/util/ttyio.c +++ b/util/ttyio.c @@ -179,8 +179,12 @@ init_ttyfp(void) void tty_enable_completion(rl_completion_func_t *completer) { + if( no_terminal ) + return; + if( !initialized ) init_ttyfp(); + rl_attempted_completion_function=completer; rl_inhibit_completion=0; } @@ -188,8 +192,12 @@ tty_enable_completion(rl_completion_func_t *completer) void tty_disable_completion(void) { + if( no_terminal ) + return; + if( !initialized ) init_ttyfp(); + rl_inhibit_completion=1; } #endif /*HAVE_LIBREADLINE*/ |