]> granicus.if.org Git - python/commitdiff
Separate readline initialization into new function PyOS_ReadlineInit().
authorGuido van Rossum <guido@python.org>
Tue, 9 Apr 1996 02:45:31 +0000 (02:45 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 9 Apr 1996 02:45:31 +0000 (02:45 +0000)
For Dave Ascher's readline extensions.

Parser/myreadline.c

index dd00077d0ee839e58c70504f28ff3414d8d963c1..99ae6acda6c61a506da705d263969105c010c20c 100644 (file)
@@ -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