From: Guido van Rossum Date: Tue, 9 Apr 1996 02:45:31 +0000 (+0000) Subject: Separate readline initialization into new function PyOS_ReadlineInit(). X-Git-Tag: v1.4b1~248 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=adf876938a242dc7b476d82565b968471c2919b3;p=python Separate readline initialization into new function PyOS_ReadlineInit(). For Dave Ascher's readline extensions. --- diff --git a/Parser/myreadline.c b/Parser/myreadline.c index dd00077d0e..99ae6acda6 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