From 18487b02b48a57c5d331bfb417feef451501cb51 Mon Sep 17 00:00:00 2001 From: tgoodwin Date: Fri, 27 Feb 1998 17:26:03 +0000 Subject: next attempt to get readline interaction correct --- input.c | 32 ++++++-------------------------- 1 file changed, 6 insertions(+), 26 deletions(-) (limited to 'input.c') diff --git a/input.c b/input.c index 6f8b755..ef9b419 100644 --- a/input.c +++ b/input.c @@ -2,7 +2,6 @@ #include #include -#include #include "rc.h" #include "jbwrap.h" @@ -22,29 +21,6 @@ typedef struct Input { #define BUFSIZE ((size_t) 256) -#if READLINE -extern void add_history(char *); -extern char *readline(char *); - -static char *rlinebuf, *prompt; -bool in_readline; - -static char *rc_readline(char *prompt) { - char *r; - void (*old)(int); - - in_readline = TRUE; - old = signal(SIGINT, sigint); - r = readline(prompt); - signal(SIGINT, old); - in_readline = FALSE; - sigchk(); - - return r; -} - -#endif - static char *prompt2; bool rcrc; @@ -65,6 +41,10 @@ static void (*realugchar)(int); int last; +#if READLINE +static char *rlinebuf, *prompt; +#endif + extern int gchar() { int c; @@ -133,8 +113,8 @@ static int fdgchar() { #endif /* There is a possible problem here. POSIX allows read() interrupted -by a signal to return -1 and set errno == EINTR *even if data have -successfully been read*. (They are also allowed to do the Right Thing, +by a signal to return -1 and set errno == EINTR *even if some data have +successfully been read*. (It is also allowed to do the Right Thing, and return a count of the partial read.) If you have such a broken system, you lose. */ { -- cgit v1.2.3