From adf876938a242dc7b476d82565b968471c2919b3 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Tue, 9 Apr 1996 02:45:31 +0000 Subject: Separate readline initialization into new function PyOS_ReadlineInit(). For Dave Ascher's readline extensions. --- Parser/myreadline.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/Parser/myreadline.c b/Parser/myreadline.c index dd00077..99ae6ac 100644 --- a/Parser/myreadline.c +++ b/Parser/myreadline.c @@ -100,14 +100,9 @@ my_fgets(buf, len, fp) #endif /* WITH_READLINE */ -char * -my_readline(prompt) - char *prompt; +void +PyOS_ReadlineInit() { - int n; - char *p; -#ifdef WITH_READLINE - RETSIGTYPE (*old_inthandler)(); static int been_here; if (!been_here) { /* Force rebind of TAB to insert-tab */ @@ -115,6 +110,18 @@ my_readline(prompt) rl_bind_key('\t', rl_insert); been_here++; } +} + + +char * +my_readline(prompt) + char *prompt; +{ + int n; + char *p; +#ifdef WITH_READLINE + RETSIGTYPE (*old_inthandler)(); + PyOS_ReadlineInit(); old_inthandler = signal(SIGINT, onintr); if (setjmp(jbuf)) { #ifdef HAVE_SIGRELSE -- cgit v0.12