diff options
| author | tgoodwin <tgoodwin> | 1998-02-23 15:45:05 +0000 |
|---|---|---|
| committer | Toby Goodwin <toby@paccrat.org> | 2015-05-16 21:23:05 +0100 |
| commit | ac8a8fcf0dad4e73b16a584d4ba3c02b89c1b86e (patch) | |
| tree | 56bf5bd2a1a0f52a66a588b33f0127e1fce0b646 /input.c | |
| parent | ed765fba692da152247018becb1f407a4ee64452 (diff) | |
incorporate Tom Culliton's patches for readline
Diffstat (limited to 'input.c')
| -rw-r--r-- | input.c | 25 |
1 files changed, 22 insertions, 3 deletions
@@ -2,6 +2,8 @@ #include <errno.h> #include <setjmp.h> +#include <signal.h> + #include "rc.h" #include "jbwrap.h" @@ -22,11 +24,28 @@ typedef struct Input { #if READLINE extern void add_history(char *); -static char *rlinebuf; -char *prompt; +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 -char *prompt2; +static char *prompt2; bool rcrc; static int dead(void); |