summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2002-12-30 16:25:41 (GMT)
committerGuido van Rossum <guido@python.org>2002-12-30 16:25:41 (GMT)
commitfaf5e4d48f9d8cb78a35e71c560dda8d1d2d7115 (patch)
treea89a21dd868d8025845cb9bd92f984b37f9bf58a /Modules
parent1fb22bb24fd395a12a225b2418ea8d22d5b37610 (diff)
downloadcpython-faf5e4d48f9d8cb78a35e71c560dda8d1d2d7115.zip
cpython-faf5e4d48f9d8cb78a35e71c560dda8d1d2d7115.tar.gz
cpython-faf5e4d48f9d8cb78a35e71c560dda8d1d2d7115.tar.bz2
Patch 659834 by Magnus Lie Hetland:
Check for readline 2.2 features. This should make it possible to compile readline.c again with GNU readline versions 2.0 or 2.1; this ability was removed in readline.c rev. 2.49. Apparently the older versions are still in widespread deployment on older Solaris installations. With an older readline, completion behavior is subtly different (a space is always added).
Diffstat (limited to 'Modules')
-rw-r--r--Modules/readline.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/readline.c b/Modules/readline.c
index 462d52f..a4bfc62 100644
--- a/Modules/readline.c
+++ b/Modules/readline.c
@@ -574,7 +574,9 @@ setup_readline(void)
rl_completer_word_break_characters =
strdup(" \t\n`~!@#$%^&*()-=+[{]}\\|;:'\",<>/?");
/* All nonalphanums except '.' */
+#ifdef HAVE_RL_COMPLETION_APPEND_CHARACTER
rl_completion_append_character ='\0';
+#endif
begidx = PyInt_FromLong(0L);
endidx = PyInt_FromLong(0L);
@@ -626,7 +628,9 @@ call_readline(FILE *sys_stdin, FILE *sys_stdout, char *prompt)
if (sys_stdin != rl_instream || sys_stdout != rl_outstream) {
rl_instream = sys_stdin;
rl_outstream = sys_stdout;
+#ifdef HAVE_RL_COMPLETION_APPEND_CHARACTER
rl_prep_terminal (1);
+#endif
}
p = readline(prompt);