cpython: 1e03fd72e116 (original) (raw)

Mercurial > cpython

changeset 86265:1e03fd72e116 2.7

Issue #18458: Prevent crashes with newer versions of libedit. Its readline emulation has changed from 0-based indexing to 1-based like gnu readline. Original patch by Ronald Oussoren. [#18458]

Ned Deily nad@acm.org
date Sat, 12 Oct 2013 15:45:25 -0700
parents ced6d02097e6
children 3e2525d640d5
files Misc/NEWS Modules/readline.c
diffstat 2 files changed, 29 insertions(+), 15 deletions(-)[+] [-] Misc/NEWS 4 Modules/readline.c 40

line wrap: on

line diff

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -32,6 +32,10 @@ Core and Builtins Library ------- +- Issue #18458: Prevent crashes with newer versions of libedit. Its readline

--- a/Modules/readline.c +++ b/Modules/readline.c @@ -54,14 +54,16 @@ extern char **completion_matches(char *,

#endif /* APPLE */ static void @@ -555,21 +557,21 @@ get_history_item(PyObject *self, PyObjec return NULL; #ifdef APPLE if (using_libedit_emulation) {

+

/* * Apple's readline emulation crashes when * the index is out of range, therefore * test for that and fail gracefully. */

+

#endif /* APPLE */ using_history(); @@ -1090,11 +1103,8 @@ call_readline(FILE *sys_stdin, FILE *sys if (length > 0) #ifdef APPLE if (using_libedit_emulation) {

#endif /* APPLE */ line = history_get(length)->line;