Merged revisions 75531,75725 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r75531 | antoine.pitrou | 2009-10-19 20:17:18 +0200 (lun., 19 oct. 2009) | 4 lines

  Issue #5833: Fix extra space character in readline completion with the
  GNU readline library version 6.0.
........
  r75725 | antoine.pitrou | 2009-10-26 20:16:46 +0100 (lun., 26 oct. 2009) | 4 lines

  Some platforms have rl_completion_append_character but not rl_completion_suppress_append.
  Reported by Mark D.
........
diff --git a/Modules/readline.c b/Modules/readline.c
index f5a54bc..bff1dcb 100644
--- a/Modules/readline.c
+++ b/Modules/readline.c
@@ -759,6 +759,12 @@
 static char **
 flex_complete(char *text, int start, int end)
 {
+#ifdef HAVE_RL_COMPLETION_APPEND_CHARACTER
+	rl_completion_append_character ='\0';
+#endif
+#ifdef HAVE_RL_COMPLETION_SUPPRESS_APPEND
+	rl_completion_suppress_append = 0;
+#endif
 	Py_XDECREF(begidx);
 	Py_XDECREF(endidx);
 	begidx = PyInt_FromLong((long) start);
@@ -801,9 +807,6 @@
 	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);