diff options
Diffstat (limited to 'input.c')
| -rw-r--r-- | input.c | 32 |
1 files changed, 6 insertions, 26 deletions
@@ -2,7 +2,6 @@ #include <errno.h> #include <setjmp.h> -#include <signal.h> #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. */ { |